]> git.mxchange.org Git - friendica.git/commitdiff
Stop PortableContacts to raise warning on malformed register_policy
authorfabrixxm <fabrix.xm@gmail.com>
Tue, 6 Nov 2018 11:10:23 +0000 (12:10 +0100)
committerGitHub <noreply@github.com>
Tue, 6 Nov 2018 11:10:23 +0000 (12:10 +0100)
src/Protocol/PortableContact.php

index fb8b48d7cb39c8708371fe7646d0be8d7cfefd2d..e2d902ac5862ff69dfe8e803215ad182d06adeb2 100644 (file)
@@ -1375,7 +1375,12 @@ class PortableContact
                                        }
 
                                        $info = $data['info'];
-                                       $register_policy = constant($data['register_policy']);
+                                       if (in_array($data['register_policy'], ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'])) {
+                                               $register_policy = constant($data['register_policy']);
+                                       } else {
+                                               Logger::log("Register policy '".$data['register_policy']."' from $server_url is invalid.");
+                                               $register_policy = REGISTER_CLOSED; // set a default value
+                                       }
                                        $platform = $data['platform'];
                                }
                        }