From 46bd1704df7a6202338cf4a3690599e631c73b8d Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 29 Oct 2020 13:28:27 +0000 Subject: [PATCH] Fix notice "Undefined index: network" and warning "strpos(): Empty needle" --- src/Content/PageInfo.php | 2 +- src/Module/Contact.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content/PageInfo.php b/src/Content/PageInfo.php index 39bd35f73a..786385c3ef 100644 --- a/src/Content/PageInfo.php +++ b/src/Content/PageInfo.php @@ -292,7 +292,7 @@ class PageInfo $quotedUrl )$#isx", function ($match) use ($url) { // Stripping URLs with no label - if (!isset($match[1])) { + if (empty($match[1])) { return ''; } diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 17b598a98b..08256bcf56 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -937,7 +937,7 @@ class Contact extends BaseModule ], ]; - if (in_array($contact['network'], [Protocol::FEED, Protocol::MAIL]) && ($cid != $pcid)) { + if (!empty($contact['network']) && in_array($contact['network'], [Protocol::FEED, Protocol::MAIL]) && ($cid != $pcid)) { $tabs[] = ['label' => DI::l10n()->t('Advanced'), 'url' => 'contact/' . $cid . '/advanced/', 'sel' => (($active_tab == self::TAB_ADVANCED) ? 'active' : ''),