Skip to content
Snippets Groups Projects
Commit a3dabf0a authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

fix loop over config with missing regex section.

parent 5ce8099f
No related branches found
No related tags found
1 merge request!2fix loop over config with missing regex section.
......@@ -23,6 +23,7 @@
* 2019-04-25 v1.2 ah use REQUEST_URI (works on Win and Linux)
* 2020-05-06 v1.3 ah added aliases for multiple domains with the same config
* 2020-05-06 v1.4 ah rewrite as class
* 2023-08-28 v1.5 ah fix loop over config with missing regex section.
*/
/**
......@@ -229,8 +230,8 @@ class redirect {
$aRedirect = $this->aConfig['direct'][$this->sRequest];
} else {
$this->_wd("no direct match ... scanning regex");
if(isset($this->aConfig['regex']) && is_array($this->aConfig['regex'])){
foreach (array_keys($this->aConfig['regex']) as $sRegex) {
$this->_wd("check if regex [$sRegex] matches $this->sRequest");
if (preg_match('#' . $sRegex . '#', $this->sRequest)) {
$this->_wd("REGEX MATCH! aborting tests");
......@@ -239,6 +240,7 @@ class redirect {
}
}
}
}
$this->aRedirect=$aRedirect;
return $aRedirect;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment