Use preg_quote instead of str_replace in include/items

This commit is contained in:
Hypolite Petovan 2018-12-27 19:23:01 -05:00
父節點 5e1ceb57de
當前提交 ea1946ec03
共有 1 個檔案被更改,包括 1 行新增2 行删除

查看文件

@ -203,8 +203,7 @@ function add_page_info_to_body($body, $texturl = false, $no_photos = false)
$body = $removedlink;
}
$url = str_replace(['/', '.'], ['\/', '\.'], $matches[1]);
$removedlink = preg_replace("/\[url\=" . $url . "\](.*?)\[\/url\]/ism", '', $body);
$removedlink = preg_replace("/\[url\=" . preg_quote($matches[1], '/') . "\](.*?)\[\/url\]/ism", '', $body);
if (($removedlink == "") || strstr($body, $removedlink)) {
$body = $removedlink;
}