From c1dec50248970ef9b9bca29a49b347c8076b5dc6 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 13 Jan 2019 18:03:13 +0000 Subject: [PATCH] Avoiding some notices --- src/Model/Contact.php | 3 +++ src/Module/Login.php | 4 ++-- src/Util/JsonLD.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 90b86789cc..c6e11bca67 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -579,6 +579,9 @@ class Contact extends BaseObject */ public static function terminateFriendship(array $user, array $contact, $dissolve = false) { + if (empty($contact['network'])) { + return; + } if (($contact['network'] == Protocol::DFRN) && $dissolve) { DFRN::deliver($user, $contact, 'placeholder', true); } elseif (in_array($contact['network'], [Protocol::OSTATUS, Protocol::DFRN])) { diff --git a/src/Module/Login.php b/src/Module/Login.php index b312a7879d..41ea917cf3 100644 --- a/src/Module/Login.php +++ b/src/Module/Login.php @@ -48,10 +48,10 @@ class Login extends BaseModule public static function post() { - $return_path = $_SESSION['return_path']; + $return_path = defaults($_SESSION, 'return_path', ''); session_unset(); $_SESSION['return_path'] = $return_path; - + // OpenId Login if ( empty($_POST['password']) diff --git a/src/Util/JsonLD.php b/src/Util/JsonLD.php index 062fb00cd4..e9c52d3d05 100644 --- a/src/Util/JsonLD.php +++ b/src/Util/JsonLD.php @@ -95,7 +95,7 @@ class JsonLD // Workaround for Nextcloud Social // See issue https://github.com/nextcloud/social/issues/330 - if (is_array($json['@context'])) { + if (!empty($json['@context']) && is_array($json['@context'])) { $json['@context'][] = 'https://w3id.org/security/v1'; }