X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FItem.php;h=30c29e1518b18cea736de93613f6a9c9657abd3a;hb=b0d8a2fcd087c2a7c34460ced3c7334eccaa1c0a;hp=4790f9f6d7b4f2ebb829a197a4ddea8ddc6e6113;hpb=a0f65ca7a1b1fbc1a2d0f823940211377fc6e13e;p=friendica.git diff --git a/src/Model/Item.php b/src/Model/Item.php index 4790f9f6d7..30c29e1518 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1150,7 +1150,7 @@ class Item extends BaseObject private static function guid($item, $notify) { if (!empty($item['guid'])) { - return Strings::removeTags(trim($item['guid'])); + return Strings::escapeTags(trim($item['guid'])); } if ($notify) { @@ -1265,7 +1265,7 @@ class Item extends BaseObject } $item['guid'] = self::guid($item, $notify); - $item['uri'] = Strings::removeTags(trim(defaults($item, 'uri', self::newURI($item['uid'], $item['guid'])))); + $item['uri'] = Strings::escapeTags(trim(defaults($item, 'uri', self::newURI($item['uid'], $item['guid'])))); // Store URI data $item['uri-id'] = ItemURI::insert(['uri' => $item['uri'], 'guid' => $item['guid']]); @@ -1535,7 +1535,7 @@ class Item extends BaseObject Logger::log("Checking if parent ".$parent_id." has to be tagged as mention for user ".$item['uid'], Logger::DEBUG); $user = DBA::selectFirst('user', ['nickname'], ['uid' => $item['uid']]); if (DBA::isResult($user)) { - $self = normalise_link(System::baseUrl() . '/profile/' . $user['nickname']); + $self = Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname']); $self_id = Contact::getIdForURL($self, 0, true); Logger::log("'myself' is ".$self_id." for parent ".$parent_id." checking against ".$item['author-id']." and ".$item['owner-id'], Logger::DEBUG); if (($item['author-id'] == $self_id) || ($item['owner-id'] == $self_id)) { @@ -2403,7 +2403,7 @@ class Item extends BaseObject public static function setHashtags(&$item) { - $tags = get_tags($item["body"]); + $tags = BBCode::getTags($item["body"]); // No hashtags? if (!count($tags)) { @@ -2545,18 +2545,18 @@ class Item extends BaseObject return; } - $link = normalise_link(System::baseUrl() . '/profile/' . $user['nickname']); + $link = Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname']); /* * Diaspora uses their own hardwired link URL in @-tags * instead of the one we supply with webfinger */ - $dlink = normalise_link(System::baseUrl() . '/u/' . $user['nickname']); + $dlink = Strings::normaliseLink(System::baseUrl() . '/u/' . $user['nickname']); $cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism', $item['body'], $matches, PREG_SET_ORDER); if ($cnt) { foreach ($matches as $mtch) { - if (link_compare($link, $mtch[1]) || link_compare($dlink, $mtch[1])) { + if (Strings::compareLink($link, $mtch[1]) || Strings::compareLink($dlink, $mtch[1])) { $mention = true; Logger::log('mention found: ' . $mtch[2]); } @@ -3447,7 +3447,7 @@ class Item extends BaseObject $filesubtype = 'unkn'; } - $title = escape_tags(trim(!empty($mtch[4]) ? $mtch[4] : $mtch[1])); + $title = Strings::escapeHtml(trim(!empty($mtch[4]) ? $mtch[4] : $mtch[1])); $title .= ' ' . $mtch[2] . ' ' . L10n::t('bytes'); $icon = '
';