Skip to content

Commit b119a5f

Browse files
author
bnu
committed
Merge branch 'release/1.11.5'
2 parents edd5280 + abb3f43 commit b119a5f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

classes/module/ModuleHandler.class.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ function init()
218218
$dbInfo = Context::getDBInfo();
219219
$defaultUrlInfo = parse_url($dbInfo->default_url);
220220
$defaultHost = $defaultUrlInfo['host'];
221+
$siteDomain = parse_url($site_module_info->domain);
222+
$siteDomain = $siteDomain['host'];
221223

222224
foreach($urls as $url)
223225
{
@@ -229,14 +231,13 @@ function init()
229231
$urlInfo = parse_url(urldecode($url));
230232
$host = $urlInfo['host'];
231233

232-
if((!$urlInfo || !$host) && preg_match("/^(https?|[a-z0-9])+\:(\/)*/i", $uri) === 0)
234+
if($host && ($host !== $defaultHost && ($host !== $site_module_info->domain || $host !== $siteDomain)))
233235
{
234-
throw new Exception('msg_invalid_request');
236+
throw new Exception('msg_default_url_is_null');
235237
}
236-
237-
if($host && ($host != $defaultHost && $host != $site_module_info->domain))
238+
else if((!$host || !$urlInfo || !$urlInfo['scheme']) && preg_match("/^(https?|[a-z0-9])+\:(\/)*/i", urldecode($url)))
238239
{
239-
throw new Exception('msg_default_url_is_null');
240+
throw new exception('msg_invalid_request');
240241
}
241242
}
242243

0 commit comments

Comments
 (0)