From 7a2f2e4ac55bb17193a442059b231a7bd2b5b69c Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Fri, 18 Aug 2023 14:48:58 +0200 Subject: support utest mode by removing uok in redirects --- it_url.class | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'it_url.class') 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')) { -- cgit v1.2.3