diff options
author | Urban Müller | 2023-08-18 14:48:58 +0200 |
---|---|---|
committer | Urban Müller | 2023-08-18 14:49:57 +0200 |
commit | 7a2f2e4ac55bb17193a442059b231a7bd2b5b69c (patch) | |
tree | 0dc177284be5ff6f890fa082b173b38cadceb1cd | |
parent | 7d334cfbaeeef216f5a65260ffc2f4edce68adf3 (diff) | |
download | itools-7a2f2e4ac55bb17193a442059b231a7bd2b5b69c.tar.gz itools-7a2f2e4ac55bb17193a442059b231a7bd2b5b69c.tar.bz2 itools-7a2f2e4ac55bb17193a442059b231a7bd2b5b69c.zip |
support utest mode by removing uok in redirects
-rw-r--r-- | it_url.class | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/it_url.class b/it_url.class index d66125d..ec4d62d 100644 --- a/it_url.class +++ b/it_url.class @@ -882,8 +882,11 @@ static function redirect($url = null, $type = "temporary") $url = preg_replace("/[\r\n].*/", '', it_url::absolute($url)); # Security: cut after CR/LF - if (!$_POST && $url == it_url::absolute($_SERVER['REQUEST_URI'])) - it::error("redirect to self. " . it_url::absolute($_SERVER['REQUEST_URI']) . " -> $url"); + if (EDC('utest')) + $url = it::replace(['[?&]uok=1' => ""], $url); # remove marker for correctly passed through U() + + if (!$_POST && $url == static::absolute($_SERVER['REQUEST_URI'])) + it::error("redirect to self. " . static::absolute($_SERVER['REQUEST_URI']) . " -> $url"); if (EDC('noredir')) { |