function allowed_email($email)
{
$domain = strtolower(substr($email, strpos($email, '@') + 1));
- if (! $domain) {
+ if (!$domain) {
return false;
}
$str_allowed = Config::get('system', 'allowed_email', '');
+ if (!x($str_allowed)) {
+ return true;
+ }
+
$allowed = explode(',', $str_allowed);
return allowed_domain($domain, $allowed);
/**
* Checks for the existence of a domain in a domain list
*
- * If strict is not set, an empty domain list counts as found
- *
* @brief Checks for the existence of a domain in a domain list
* @param string $domain
- * @param array $domain_list
- * @param bool $strict
+ * @param array $domain_list
* @return boolean
*/
-function allowed_domain($domain, array $domain_list, $strict = false)
+function allowed_domain($domain, array $domain_list)
{
$found = false;
- if (count($domain_list)) {
- foreach ($domain_list as $item) {
- $pat = strtolower(trim($item));
- if (fnmatch($pat, $domain) || ($pat == $domain)) {
- $found = true;
- break;
- }
+ foreach ($domain_list as $item) {
+ $pat = strtolower(trim($item));
+ if (fnmatch($pat, $domain) || ($pat == $domain)) {
+ $found = true;
+ break;
}
- } elseif(!$strict) {
- $found = true;
}
+
return $found;
}
$license = '';
- $o = get_markup_template("register.tpl");
+ $tpl = get_markup_template("register.tpl");
- $arr = array('template' => $o);
+ $arr = array('template' => $tpl);
call_hooks('register_form', $arr);
- $o = $arr['template'];
+ $tpl = $arr['template'];
- $o = replace_macros($o, [
+ $o = replace_macros($tpl, [
'$oidhtml' => $oidhtml,
'$invitations' => Config::get('system', 'invitation_only'),
'$permonly' => $a->config['register_policy'] == REGISTER_APPROVE,
}\r
\r
$domain = parse_url($url, PHP_URL_HOST);\r
+ if (!x($domain)) {\r
+ return false;\r
+ }\r
\r
$str_allowed = Config::get('system', 'allowed_oembed', '');\r
+ if (!x($str_allowed)) {\r
+ return false;\r
+ }\r
+ \r
$allowed = explode(',', $str_allowed);\r
\r
- return allowed_domain($domain, $allowed, true);\r
+ return allowed_domain($domain, $allowed);\r
}\r
\r
public static function getHTML($url, $title = null)\r