]> git.mxchange.org Git - friendica.git/commitdiff
Avoiding some notices
authorMichael <heluecht@pirati.ca>
Sun, 13 Jan 2019 18:03:13 +0000 (18:03 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 13 Jan 2019 18:03:13 +0000 (18:03 +0000)
src/Model/Contact.php
src/Module/Login.php
src/Util/JsonLD.php

index 90b86789cc5e8b9201016f2b8cc7c4defc0cb562..c6e11bca67c6e0400d4c2d440d4a80ac2480b2c0 100644 (file)
@@ -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])) {
index b312a7879dbc90ae525f1b7ee9edba2ed7c963e1..41ea917cf3e8087c49e6ccbee8502afea1feefe5 100644 (file)
@@ -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'])
index 062fb00cd44768f99f23cc2c8bbb516899de2fb0..e9c52d3d050a8594cdf31e7f0822b76e3e3b93fa 100644 (file)
@@ -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';
                }