diff --git a/common/framework/URL.php b/common/framework/URL.php index e4dadae3f..6752eb99d 100644 --- a/common/framework/URL.php +++ b/common/framework/URL.php @@ -258,7 +258,12 @@ class URL $position = 0; } - if (function_exists('idn_to_utf8')) + $domain = (string)$domain; + if ($domain === '') + { + $new_domain = ''; + } + elseif (function_exists('idn_to_utf8')) { $new_domain = idn_to_utf8($domain); } diff --git a/modules/module/module.model.php b/modules/module/module.model.php index 79c1c2f7d..4530f252b 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -195,13 +195,13 @@ class ModuleModel extends Module /** * @brief Get the default mid according to the domain */ - public static function getDefaultMid($domain = null) + public static function getDefaultMid($domain = '') { // Get current domain. $domain = $domain ? Rhymix\Framework\URL::decodeIdna($domain) : Rhymix\Framework\URL::getCurrentDomain(); // Find the domain information. - $domain_info = self::getSiteInfoByDomain($domain); + $domain_info = $domain ? self::getSiteInfoByDomain($domain) : null; if (!$domain_info) { $domain_info = self::getDefaultDomainInfo();