Skip to content

Commit 19ea39c

Browse files
authored
Return empty string for empty input in bbcode.php
1 parent f9205f1 commit 19ea39c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

trunk/web/include/bbcode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static public function bbcode_to_html($input) : string
120120
// 定义正则表达式
121121
//$regex = '/<(?!div)/';
122122
//$input = preg_replace($regex, '&lt;', $input);
123-
123+
if(empty($input)) return "";
124124
//尝试自动修复有问题的html片段
125125
$dom = new DOMDocument();
126126
// 使用 @ 抑制非标准 HTML5 标签引发的警告

0 commit comments

Comments
 (0)