Skip to content

Commit

Permalink
Merge branch 'release/1.11.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
bnu committed Apr 2, 2019
2 parents edd5280 + abb3f43 commit b119a5f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions classes/module/ModuleHandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ function init()
$dbInfo = Context::getDBInfo();
$defaultUrlInfo = parse_url($dbInfo->default_url);
$defaultHost = $defaultUrlInfo['host'];
$siteDomain = parse_url($site_module_info->domain);
$siteDomain = $siteDomain['host'];

foreach($urls as $url)
{
Expand All @@ -229,14 +231,13 @@ function init()
$urlInfo = parse_url(urldecode($url));
$host = $urlInfo['host'];

if((!$urlInfo || !$host) && preg_match("/^(https?|[a-z0-9])+\:(\/)*/i", $uri) === 0)
if($host && ($host !== $defaultHost && ($host !== $site_module_info->domain || $host !== $siteDomain)))
{
throw new Exception('msg_invalid_request');
throw new Exception('msg_default_url_is_null');
}

if($host && ($host != $defaultHost && $host != $site_module_info->domain))
else if((!$host || !$urlInfo || !$urlInfo['scheme']) && preg_match("/^(https?|[a-z0-9])+\:(\/)*/i", urldecode($url)))
{
throw new Exception('msg_default_url_is_null');
throw new exception('msg_invalid_request');
}
}

Expand Down

0 comments on commit b119a5f

Please sign in to comment.