From: Hypolite Petovan Date: Fri, 28 Dec 2018 00:23:01 +0000 (-0500) Subject: Use preg_quote instead of str_replace in include/items X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ea1946ec03bd26a1bff011b9f2f25d1c17a9f9f3;p=friendica.git Use preg_quote instead of str_replace in include/items --- diff --git a/include/items.php b/include/items.php index ddec2231d8..db60519a2c 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; }