Fix domain restriction not being enforced when $document_srl is set

This commit is contained in:
Kijin Sung 2025-08-31 23:55:17 +09:00
parent 70e04a1dc5
commit b79af31d0e

View file

@ -182,6 +182,9 @@ class ModuleHandler extends Handler
}
}
// Initialize module info.
$module_info = null;
// Get module info from document_srl.
if($this->document_srl)
{
@ -191,15 +194,14 @@ class ModuleHandler extends Handler
return false;
}
}
else
{
$module_info = null;
}
// Get module info from mid.
if(!$module_info && $this->mid)
{
$module_info = ModuleModel::getModuleInfoByMid($this->mid);
}
// If the module does not belong to the current domain, throw a 404.
if($module_info && isset($module_info->domain_srl) && $module_info->domain_srl > -1)
{
if($module_info->domain_srl != $site_module_info->domain_srl)
@ -209,7 +211,6 @@ class ModuleHandler extends Handler
return true;
}
}
}
// Set module info as the default module for the domain.
if(!$module_info && !$this->module && !$this->mid)