Skip to content

Commit

Permalink
解决php8.2一处报错问题 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrotty authored Jun 21, 2024
1 parent 8b2ebd2 commit 5035c0b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
*
* @package Links
* @author 懵仙兔兔
* @version 1.2.6
* @version 1.2.7
* @dependence 14.10.10-*
* @link https://2dph.com
*
* version 1.2.7 at 2024-06-21 by 泽泽社长
* 解决php8.2一处报错问题
*
* version 1.2.6 at 2023-05-15 by 泽泽社长
* 支持主题作者自定义友链 html 结构
*
Expand Down Expand Up @@ -528,7 +531,7 @@ public static function parse($text, $widget, $lastResult)
$text = empty($lastResult) ? $text : $lastResult;

if ($widget instanceof Widget_Archive || $widget instanceof Widget_Abstract_Comments) {
return preg_replace_callback("/<links\s*(\d*)\s*(\w*)\s*(\d*)>\s*(.*?)\s*<\/links>/is", array('Links_Plugin', 'parseCallback'), $text);
return preg_replace_callback("/<links\s*(\d*)\s*(\w*)\s*(\d*)>\s*(.*?)\s*<\/links>/is", array('Links_Plugin', 'parseCallback'), $text?$text:'');
} else {
return $text;
}
Expand Down

0 comments on commit 5035c0b

Please sign in to comment.