link_compare calls

implement compareLink function.
This commit is contained in:
Adam Magness 2018-11-08 10:46:50 -05:00
parent 6fc9c6de3b
commit 5276c28a78
19 changed files with 32 additions and 30 deletions

View file

@ -2403,7 +2403,7 @@ class Item extends BaseObject
public static function setHashtags(&$item)
{
$tags = get_tags($item["body"]);
$tags = Strings::getTags($item["body"]);
// No hashtags?
if (!count($tags)) {
@ -2556,7 +2556,7 @@ class Item extends BaseObject
$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]);
}

View file

@ -1141,7 +1141,7 @@ class Profile
}
$achar = strpos($s, '?') ? '&' : '?';
$mine = self::getMyURL();
if ($mine && !link_compare($mine, $s)) {
if ($mine && !Strings::compareLink($mine, $s)) {
return $s . $achar . 'zrl=' . urlencode($mine);
}
return $s;

View file

@ -499,7 +499,7 @@ class User
throw new Exception(L10n::t('Your email domain is not among those allowed on this site.'));
}
if (!valid_email($email) || !Network::isEmailDomainValid($email)) {
if (!Strings::isValidEmail($email) || !Network::isEmailDomainValid($email)) {
throw new Exception(L10n::t('Not a valid email address.'));
}
if (self::isNicknameBlocked($nickname)) {