X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fitems.php;h=db60519a2ce8d6ba8d247ae207ce11fe06642862;hb=59f701d5a92712f89c1513076003d2bb8fc67a39;hp=b9e1a0c9944d97f2b2d9094b8e67dc414a5b1263;hpb=75398b96d526a22238a3edbf61247f0853b75fa7;p=friendica.git diff --git a/include/items.php b/include/items.php index b9e1a0c994..db60519a2c 100644 --- a/include/items.php +++ b/include/items.php @@ -24,10 +24,7 @@ use Friendica\Util\ParseUrl; use Friendica\Util\Strings; use Friendica\Util\Temporal; -require_once 'include/text.php'; require_once 'mod/share.php'; -require_once 'include/enotify.php'; - function add_page_info_data(array $data, $no_photos = false) { Addon::callHooks('page_info_data', $data); @@ -97,7 +94,7 @@ function add_page_info_data(array $data, $no_photos = false) /// @TODO make a positive list of allowed characters $hashtag = str_replace([" ", "+", "/", ".", "#", "'", "’", "`", "(", ")", "„", "“"], ["", "", "", "", "", "", "", "", "", "", "", ""], $keyword); - $hashtags .= "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url] "; + $hashtags .= "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url] "; } } @@ -148,7 +145,7 @@ function add_page_keywords($url, $photo = "", $keywords = false, $keyword_blackl $tags .= ", "; } - $tags .= "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url]"; + $tags .= "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url]"; } } @@ -206,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; } @@ -352,7 +348,7 @@ function drop_item($id, $return = '') // locate item to be deleted - $fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', parent]; + $fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent']; $item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]); if (!DBA::isResult($item)) {