From 880b7177c8430b40336df541eb227d14db8bff7c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 11 Aug 2018 23:05:42 +0200 Subject: [PATCH] And again, and again, and again, ... some more notices removed (#5601) * And again, and again, and again, ... some more notices removed * And some more notices ... * Some more place --- mod/bookmarklet.php | 4 ++-- mod/item.php | 4 ++-- src/Content/Nav.php | 2 +- src/Content/Widget/CalendarExport.php | 4 ++++ view/theme/frio/templates/profile_edit.tpl | 2 ++ 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mod/bookmarklet.php b/mod/bookmarklet.php index a26757740a..21b2039c58 100644 --- a/mod/bookmarklet.php +++ b/mod/bookmarklet.php @@ -26,7 +26,7 @@ function bookmarklet_content(App $a) return $o; } - $referer = normalise_link($_SERVER["HTTP_REFERER"]); + $referer = normalise_link(defaults($_SERVER, 'HTTP_REFERER', '')); $page = normalise_link(System::baseUrl() . "/bookmarklet"); if (!strstr($referer, $page)) { @@ -43,7 +43,7 @@ function bookmarklet_content(App $a) 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), - 'title' => trim($_REQUEST["title"], "*"), + 'title' => trim(defaults($_REQUEST, 'title', ''), "*"), 'content' => $content ]; $o = status_editor($a, $x, 0, false); diff --git a/mod/item.php b/mod/item.php index 125606d277..be3af101d9 100644 --- a/mod/item.php +++ b/mod/item.php @@ -395,12 +395,12 @@ function item_post(App $a) { $tagged[] = $tag; } // When the forum is private or the forum is addressed with a "!" make the post private - if (is_array($success['contact']) && ($success['contact']['prv'] || ($tag_type == '!'))) { + if (is_array($success['contact']) && (!empty($success['contact']['prv']) || ($tag_type == '!'))) { $private_forum = $success['contact']['prv']; $only_to_forum = ($tag_type == '!'); $private_id = $success['contact']['id']; $forum_contact = $success['contact']; - } elseif (is_array($success['contact']) && $success['contact']['forum'] && + } elseif (is_array($success['contact']) && !empty($success['contact']['forum']) && ($str_contact_allow == '<' . $success['contact']['id'] . '>')) { $private_forum = false; $only_to_forum = true; diff --git a/src/Content/Nav.php b/src/Content/Nav.php index 60937ff7b1..99decc92bb 100644 --- a/src/Content/Nav.php +++ b/src/Content/Nav.php @@ -186,7 +186,7 @@ class Nav $nav['home'] = ['profile/' . $a->user['nickname'], L10n::t('Home'), '', L10n::t('Your posts and conversations')]; // Don't show notifications for public communities - if ($_SESSION['page_flags'] != Contact::PAGE_COMMUNITY) { + if (defaults($_SESSION, 'page_flags', '') != Contact::PAGE_COMMUNITY) { $nav['introductions'] = ['notifications/intros', L10n::t('Introductions'), '', L10n::t('Friend Requests')]; $nav['notifications'] = ['notifications', L10n::t('Notifications'), '', L10n::t('Notifications')]; $nav['notifications']['all'] = ['notifications/system', L10n::t('See all notifications'), '', '']; diff --git a/src/Content/Widget/CalendarExport.php b/src/Content/Widget/CalendarExport.php index 0e85e16c46..2c21b2f0d0 100644 --- a/src/Content/Widget/CalendarExport.php +++ b/src/Content/Widget/CalendarExport.php @@ -27,6 +27,10 @@ class CalendarExport public static function getHTML() { $a = get_app(); + if (empty($a->data['user'])) { + return; + } + $owner_uid = $a->data['user']['uid']; // The permission testing is a little bit tricky because we have to respect many cases. diff --git a/view/theme/frio/templates/profile_edit.tpl b/view/theme/frio/templates/profile_edit.tpl index c06e3a7159..cd4ed1816f 100644 --- a/view/theme/frio/templates/profile_edit.tpl +++ b/view/theme/frio/templates/profile_edit.tpl @@ -318,8 +318,10 @@ + + -- 2.39.5