From ea1946ec03bd26a1bff011b9f2f25d1c17a9f9f3 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 27 Dec 2018 19:23:01 -0500 Subject: [PATCH] Use preg_quote instead of str_replace in include/items --- include/items.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/items.php b/include/items.php index ddec2231d..db60519a2 100644 --- a/include/items.php +++ b/include/items.php @@ -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; }