Fix multidomain not working when domain is IDN

This commit is contained in:
Kijin Sung 2020-03-26 22:12:33 +09:00
parent 7c9b356662
commit 3ca551e5f2
2 changed files with 14 additions and 13 deletions

View file

@ -177,10 +177,11 @@ class moduleModel extends module
/**
* @brief Get the default mid according to the domain
*/
function getDefaultMid()
function getDefaultMid($domain = null)
{
// Get current domain.
$domain = strtolower(preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST']));
$domain = $domain ?: strtolower(preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST']));
$domain = Rhymix\Framework\URL::decodeIdna($domain);
// Find the domain information.
$domain_info = $this->getSiteInfoByDomain($domain);