File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments