diff --git a/mod/friendica.php b/mod/friendica.php index 2629a0a19..0e647eb5e 100644 --- a/mod/friendica.php +++ b/mod/friendica.php @@ -52,7 +52,7 @@ function friendica_init(App $a) 'locked_features' => $locked_features, 'explicit_content' => (int)Config::get('system', 'explicit_content', false), 'language' => Config::get('system','language'), - 'register_policy ' => $register_policy[intval(Config::get('config', 'register_policy'))], + 'register_policy' => $register_policy[intval(Config::get('config', 'register_policy'))], 'admin' => $admin, 'site_name' => Config::get('config', 'sitename'), 'platform' => FRIENDICA_PLATFORM, diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index fb8b48d7c..9c22a2163 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']; } }