From 1858204cbdb6febbebb8d148b67302334b575e49 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Tue, 6 Nov 2018 12:10:23 +0100 Subject: [PATCH] Stop PortableContacts to raise warning on malformed register_policy --- src/Protocol/PortableContact.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index fb8b48d7cb..e2d902ac58 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -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']; } } -- 2.39.5