Stop PortableContacts to raise warning on malformed register_policy

This commit is contained in:
fabrixxm 2018-11-06 12:10:23 +01:00 committed by GitHub
parent 56484eaaeb
commit 1858204cbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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'];
}
}