Clicking from search result alias/child domain fails to open
When you use the search function to look for an alias or child domain it shows the result but clicking the link fails to open.
With the Firefox developer tools I noticed that the https response was 'redirect contains unallowed chars.'
It tries to load capp.php?mod=sites&redirect=sites/web_childdomain_edit.php%3Fid%3D291%26type%3Daliasdomain
The %26
in there is the & char, from the extra 'type=aliasdomain' parameter. Regular domains only get the id
parameter.
The patch below is a quick fix to allow the extra type
parameter. Would that be sufficient?
diff --git a/interface/web/capp.php b/interface/web/capp.php
index 39392691f..5d49fe80d 100755
--- a/interface/web/capp.php
+++ b/interface/web/capp.php
@@ -43,7 +43,7 @@ if($_SESSION["s"]["user"]['active'] != 1) {
}
if(!preg_match("/^[a-z]{2,20}$/i", $mod)) die('module name contains unallowed chars.');
-if($redirect != '' && !preg_match("/^[a-z0-9]+\/[a-z0-9_\.\-]+\?id=[0-9]{1,9}$/i", $redirect)) die('redirect contains unallowed chars.');
+if($redirect != '' && !preg_match("/^[a-z0-9]+\/[a-z0-9_\.\-]+\?id=[0-9]{1,9}(\&type=[a-z0-9_\.\-]+)?$/i", $redirect)) die('redirect contains unallowed chars.');
//* Check if user may use the module.
$user_modules = explode(",", $_SESSION["s"]["user"]["modules"]);