Merge pull request #7206 from nupplaphil/issue/6918-php_notices

Fixing PHP Notices
This commit is contained in:
Hypolite Petovan 2019-05-30 09:30:26 -04:00 committed by GitHub
commit b176cb88f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 9 deletions

View File

@ -121,6 +121,9 @@ function notifications_content(App $a)
} elseif (($a->argc > 1) && ($a->argv[1] == 'home')) { } elseif (($a->argc > 1) && ($a->argv[1] == 'home')) {
$notif_header = L10n::t('Home Notifications'); $notif_header = L10n::t('Home Notifications');
$notifs = $nm->homeNotifs($show, $startrec, $perpage); $notifs = $nm->homeNotifs($show, $startrec, $perpage);
// fallback - redirect to main page
} else {
$a->internalRedirect('notifications');
} }
// Set the pager // Set the pager

View File

@ -1504,7 +1504,7 @@ function photos_content(App $a)
'$title' => $title_e, '$title' => $title_e,
'$body' => $body_e, '$body' => $body_e,
'$ago' => Temporal::getRelativeDate($item['created']), '$ago' => Temporal::getRelativeDate($item['created']),
'$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''), '$indent' => (($item['parent'] != $item['id']) ? ' comment' : ''),
'$drop' => $drop, '$drop' => $drop,
'$comment' => $comment '$comment' => $comment
]); ]);
@ -1513,7 +1513,7 @@ function photos_content(App $a)
$comments .= Renderer::replaceMacros($cmnt_tpl, [ $comments .= Renderer::replaceMacros($cmnt_tpl, [
'$return_path' => '', '$return_path' => '',
'$jsreload' => $return_path, '$jsreload' => $return_path,
'$id' => $item['item_id'], '$id' => $item['id'],
'$parent' => $item['parent'], '$parent' => $item['parent'],
'$profile_uid' => $owner_uid, '$profile_uid' => $owner_uid,
'$mylink' => $contact['url'], '$mylink' => $contact['url'],

View File

@ -3,12 +3,13 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Session;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Profile; use Friendica\Model\Profile;
use Friendica\Util\Strings;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\Strings;
function redir_init(App $a) { function redir_init(App $a) {
@ -70,7 +71,9 @@ function redir_init(App $a) {
&& is_array($_SESSION['remote'])) && is_array($_SESSION['remote']))
{ {
foreach ($_SESSION['remote'] as $v) { 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. // Remote user is already authenticated.
$target_url = defaults($url, $contact_url); $target_url = defaults($url, $contact_url);
Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG); Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG);

View File

@ -11,9 +11,9 @@ use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Lock; use Friendica\Core\Lock;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -24,10 +24,10 @@ use Friendica\Protocol\Diaspora;
use Friendica\Protocol\OStatus; use Friendica\Protocol\OStatus;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Map; use Friendica\Util\Map;
use Friendica\Util\XML; use Friendica\Util\Network;
use Friendica\Util\Security; use Friendica\Util\Security;
use Friendica\Util\Strings; use Friendica\Util\Strings;
use Friendica\Util\Network; use Friendica\Util\XML;
use Text_LanguageDetect; use Text_LanguageDetect;
class Item extends BaseObject class Item extends BaseObject
@ -87,7 +87,7 @@ class Item extends BaseObject
'unseen', 'deleted', 'origin', 'forum_mode', 'mention', 'global', 'network', 'unseen', 'deleted', 'origin', 'forum_mode', 'mention', 'global', 'network',
'title', 'content-warning', 'body', 'location', 'coord', 'app', 'title', 'content-warning', 'body', 'location', 'coord', 'app',
'rendered-hash', 'rendered-html', 'object-type', 'object', 'target-type', 'target', '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']; '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. // 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-link']);
unset($item['author-name']); unset($item['author-name']);
unset($item['author-avatar']); unset($item['author-avatar']);
unset($item['author-network']);
unset($item['owner-link']); unset($item['owner-link']);
unset($item['owner-name']); unset($item['owner-name']);

View File

@ -87,7 +87,9 @@ class Federation extends BaseAdminModule
$part = array_pop($parts); $part = array_pop($parts);
} while (!empty($parts) && ((strlen($part) >= 40) || (strlen($part) <= 3))); } 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 // 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($part)) {
if (empty($compacted[$part])) { if (empty($compacted[$part])) {
$compacted[$part] = $versionCounts[$key]['total']; $compacted[$part] = $versionCounts[$key]['total'];