]> git.mxchange.org Git - friendica.git/blobdiff - mod/ping.php
Merge pull request #5702 from annando/and-a-notice
[friendica.git] / mod / ping.php
index 4c4bc81ac1de7bc6827ac88a022c0d49f5a3dd5c..99ebde70c183a2367d8a19406b51436e66a95748 100644 (file)
@@ -19,9 +19,9 @@ use Friendica\Model\Group;
 use Friendica\Model\Item;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Temporal;
+use Friendica\Util\Proxy as ProxyUtils;
 use Friendica\Util\XML;
 
-require_once 'mod/proxy.php';
 require_once 'include/enotify.php';
 
 /**
@@ -108,7 +108,7 @@ function ping_init(App $a)
 
        if (local_user()) {
                // Different login session than the page that is calling us.
-               if (intval($_GET['uid']) && intval($_GET['uid']) != local_user()) {
+               if (!empty($_GET['uid']) && intval($_GET['uid']) != local_user()) {
                        $data = ['result' => ['invalid' => 1]];
 
                        if ($format == 'json') {
@@ -347,7 +347,7 @@ function ping_init(App $a)
 
                if (DBA::isResult($notifs)) {
                        // Are the nofications called from the regular process or via the friendica app?
-                       $regularnotifications = (intval($_GET['uid']) && intval($_GET['_']));
+                       $regularnotifications = (!empty($_GET['uid']) && !empty($_GET['_']));
 
                        foreach ($notifs as $notif) {
                                if ($a->is_friendica_app() || !$regularnotifications) {
@@ -356,9 +356,9 @@ function ping_init(App $a)
 
                                $contact = Contact::getDetailsByURL($notif['url']);
                                if (isset($contact['micro'])) {
-                                       $notif['photo'] = proxy_url($contact['micro'], false, PROXY_SIZE_MICRO);
+                                       $notif['photo'] = ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO);
                                } else {
-                                       $notif['photo'] = proxy_url($notif['photo'], false, PROXY_SIZE_MICRO);
+                                       $notif['photo'] = ProxyUtils::proxifyUrl($notif['photo'], false, ProxyUtils::SIZE_MICRO);
                                }
 
                                $local_time = DateTimeFormat::local($notif['date']);