X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fenotify.php;h=9edfaaca82b8e2ea2a5b46365b94ad74c859fd61;hb=9317a1c054675bbef7e11f21c5280f635d7ba90c;hp=339e31a3c810e01c14d3fc681e2462e687e42086;hpb=8a46c786f37550160d81e7b7ecbcacb4c9fff493;p=friendica.git diff --git a/include/enotify.php b/include/enotify.php index 339e31a3c8..9edfaaca82 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -15,6 +15,7 @@ use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Util\DateTimeFormat; use Friendica\Util\Emailer; +use Friendica\Util\Strings; /** * @brief Creates a notification entry and possibly sends a mail @@ -27,7 +28,7 @@ use Friendica\Util\Emailer; */ function notification($params) { - $a = get_app(); + $a = \get_app(); // Temporary logging for finding the origin if (!isset($params['language']) || !isset($params['uid'])) { @@ -157,7 +158,7 @@ function notification($params) $item = Item::selectFirstForUser($params['uid'], Item::ITEM_FIELDLIST, ['id' => $parent_id]); } - $item_post_type = item_post_type($item); + $item_post_type = Item::postType($item); $itemlink = $item['plink']; // "a post" @@ -457,7 +458,7 @@ function notification($params) Logger::log("adding notification entry", Logger::DEBUG); do { $dups = false; - $hash = random_string(); + $hash = Strings::getRandomHex(); if (DBA::exists('notify', ['hash' => $hash])) { $dups = true; } @@ -703,11 +704,11 @@ function check_item_notification($itemid, $uid, $defaulttype = "") { // Check for invalid profile urls. 13 should be the shortest possible profile length: // http://a.bc/d // Additionally check for invalid urls that would return the normalised value "http:" - if ((strlen($profile) >= 13) && (normalise_link($profile) != "http:")) { + if ((strlen($profile) >= 13) && (Strings::normaliseLink($profile) != "http:")) { if (!in_array($profile, $profiles2)) $profiles2[] = $profile; - $profile = normalise_link($profile); + $profile = Strings::normaliseLink($profile); if (!in_array($profile, $profiles2)) $profiles2[] = $profile; @@ -761,7 +762,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") { if (DBA::isResult($tags)) { foreach ($tags AS $tag) { - $condition = ['nurl' => normalise_link($tag["url"]), 'uid' => $uid, 'notify_new_posts' => true]; + $condition = ['nurl' => Strings::normaliseLink($tag["url"]), 'uid' => $uid, 'notify_new_posts' => true]; $r = DBA::exists('contact', $condition); if ($r) { $send_notification = true;