From 7da3f6d30e1557baf969885a357b9cb7853ecaaf Mon Sep 17 00:00:00 2001 From: David Flatz Date: Wed, 11 Feb 2015 19:20:24 +0100 Subject: warn about potential redirect loops --- it_url.class | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/it_url.class b/it_url.class index b9bb17c..02b084e 100644 --- a/it_url.class +++ b/it_url.class @@ -856,6 +856,10 @@ function redirect($url = null, $type = "temporary") it::fatal("Invalid redirect type '$type', must be 'permanent' or 'temporary'"); $url = preg_replace("/[\r\n].*/", '', it_url::absolute($url)); # Security: cut after CR/LF + + if (U($url) == U(it_url::absolute(U($_GET)))) + it::error('Potential redirect loop detected: ' . $url); + if (EDC('noredir')) { if (!function_exists('a')) new it_html(); -- cgit v1.2.3