]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #7206 from nupplaphil/issue/6918-php_notices
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 30 May 2019 13:30:26 +0000 (09:30 -0400)
committerGitHub <noreply@github.com>
Thu, 30 May 2019 13:30:26 +0000 (09:30 -0400)
Fixing PHP Notices

mod/notifications.php
mod/photos.php
mod/redir.php
src/Model/Item.php
src/Module/Admin/Federation.php

index ff954d4189250cba0cf88ccf33f01ade71ed9f35..8bc9a76c388efcaef89d1c787579d6a68a047700 100644 (file)
@@ -121,6 +121,9 @@ function notifications_content(App $a)
        } elseif (($a->argc > 1) && ($a->argv[1] == 'home')) {
                $notif_header = L10n::t('Home Notifications');
                $notifs = $nm->homeNotifs($show, $startrec, $perpage);
+       // fallback - redirect to main page
+       } else {
+               $a->internalRedirect('notifications');
        }
 
        // Set the pager
index b18c06e2a3a4e5bf4b410f47b1a83f3c910b1245..0524845b155e99d844c216ebc7637d3b94246c21 100644 (file)
@@ -1504,7 +1504,7 @@ function photos_content(App $a)
                                                '$title' => $title_e,
                                                '$body' => $body_e,
                                                '$ago' => Temporal::getRelativeDate($item['created']),
-                                               '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),
+                                               '$indent' => (($item['parent'] != $item['id']) ? ' comment' : ''),
                                                '$drop' => $drop,
                                                '$comment' => $comment
                                        ]);
@@ -1513,7 +1513,7 @@ function photos_content(App $a)
                                                $comments .= Renderer::replaceMacros($cmnt_tpl, [
                                                        '$return_path' => '',
                                                        '$jsreload' => $return_path,
-                                                       '$id' => $item['item_id'],
+                                                       '$id' => $item['id'],
                                                        '$parent' => $item['parent'],
                                                        '$profile_uid' =>  $owner_uid,
                                                        '$mylink' => $contact['url'],
index 4dbae5498b38f24079f75507f61fc8e70fce1a6a..233ec9b0079ff59a65d2b033eeda318f836ebd31 100644 (file)
@@ -3,12 +3,13 @@
 use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
+use Friendica\Core\Session;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
-use Friendica\Util\Strings;
 use Friendica\Util\Network;
+use Friendica\Util\Strings;
 
 function redir_init(App $a) {
 
@@ -70,7 +71,9 @@ function redir_init(App $a) {
                                && is_array($_SESSION['remote']))
                        {
                                foreach ($_SESSION['remote'] as $v) {
-                                       if ($v['uid'] == $_SESSION['visitor_visiting'] && $v['cid'] == $_SESSION['visitor_id']) {
+                                       if (!empty($v['uid']) && !empty($v['cid']) &&
+                                           $v['uid'] == Session::get('visitor_visiting') &&
+                                           $v['cid'] == Session::get('visitor_id')) {
                                                // Remote user is already authenticated.
                                                $target_url = defaults($url, $contact_url);
                                                Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG);
index a01ff61143f06a461060fe55503be35da69dd8f3..8ae412cd0a7d2fa7f1f416e76b424d36680ec01b 100644 (file)
@@ -11,9 +11,9 @@ use Friendica\Content\Text\BBCode;
 use Friendica\Content\Text\HTML;
 use Friendica\Core\Config;
 use Friendica\Core\Hook;
+use Friendica\Core\L10n;
 use Friendica\Core\Lock;
 use Friendica\Core\Logger;
-use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
@@ -24,10 +24,10 @@ use Friendica\Protocol\Diaspora;
 use Friendica\Protocol\OStatus;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Map;
-use Friendica\Util\XML;
+use Friendica\Util\Network;
 use Friendica\Util\Security;
 use Friendica\Util\Strings;
-use Friendica\Util\Network;
+use Friendica\Util\XML;
 use Text_LanguageDetect;
 
 class Item extends BaseObject
@@ -87,7 +87,7 @@ class Item extends BaseObject
                        'unseen', 'deleted', 'origin', 'forum_mode', 'mention', 'global', 'network',
                        'title', 'content-warning', 'body', 'location', 'coord', 'app',
                        'rendered-hash', 'rendered-html', 'object-type', 'object', 'target-type', 'target',
-                       'author-id', 'author-link', 'author-name', 'author-avatar',
+                       'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network',
                        'owner-id', 'owner-link', 'owner-name', 'owner-avatar'];
 
        // Never reorder or remove entries from this list. Just add new ones at the end, if needed.
@@ -1721,6 +1721,7 @@ class Item extends BaseObject
                unset($item['author-link']);
                unset($item['author-name']);
                unset($item['author-avatar']);
+               unset($item['author-network']);
 
                unset($item['owner-link']);
                unset($item['owner-name']);
index f32f0e2ccd6f15dcbcf2db0f16385c1804d14104..9c52845b93094f3c7a8c8e654701fc6bc2c4defb 100644 (file)
@@ -87,7 +87,9 @@ class Federation extends BaseAdminModule
                                                $part = array_pop($parts);
                                        } while (!empty($parts) && ((strlen($part) >= 40) || (strlen($part) <= 3)));
                                        // only take the x.x.x part of the version, not the "release" after the dash
-                                       $part = array_shift(explode('-', $part));
+                                       if (!empty($part) && strpos($part, '-')) {
+                                               $part = array_shift(explode('-', $part));
+                                       }
                                        if (!empty($part)) {
                                                if (empty($compacted[$part])) {
                                                        $compacted[$part] = $versionCounts[$key]['total'];