-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
55,56行代码应该互换位置。
function bat_highlight($message, $words, $color = '#ff0000') {
if(!empty($words)) {
$highlightarray = explode(' ', $words);
$sppos = strrpos($message, chr(0).chr(0).chr(0));
if($sppos !== FALSE) {
$specialextra = substr($message, $sppos + 3);
$message = substr($message, 0, $sppos);
}
$message = preg_replace("/<highlight>(.*)<\/highlight>/siU", "<strong><font color=\"$color\">\\1</font></strong>", $message);
$message = preg_replace_callback("/(^|>)([^<]+)(?=<|$)/sU", function($matches) use($highlightarray) { return highlight($matches[2], $highlightarray, $matches[1]); }, $message);
if($sppos !== FALSE) {
$message = $message.chr(0).chr(0).chr(0).$specialextra;
}
}
return $message;
}
$message = preg_replace("/<highlight>(.*)<\/highlight>/siU", "<strong><font color=\"$color\">\\1</font></strong>", $message);
$message = preg_replace_callback("/(^|>)([^<]+)(?=<|$)/sU", function($matches) use($highlightarray) { return highlight($matches[2], $highlightarray, $matches[1]); }, $message);
改为
$message = preg_replace_callback("/(^|>)([^<]+)(?=<|$)/sU", function($matches) use($highlightarray) { return highlight($matches[2], $highlightarray, $matches[1]); }, $message);
$message = preg_replace("/<highlight>(.*)<\/highlight>/siU", "<strong><font color=\"$color\">\\1</font></strong>", $message);
Metadata
Metadata
Assignees
Labels
No labels