From 791239bfb548b7524c309e7c6c522165875ae4ea Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 17 Nov 2015 15:46:05 +0100 Subject: report empty redir urls, they cause loops --- it_url.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/it_url.class b/it_url.class index fb5a1ff..2279659 100644 --- a/it_url.class +++ b/it_url.class @@ -793,8 +793,8 @@ static function absolute($url=null) function redirect($url = null, $type = "temporary") { $codes = array('permanent' => 301, 'temporary' => 303); # NOTE: HTTP 303 is called "See Other", rather than Temporary (which would be HTTP 307), but is the behaviour one usually wants for temporary redirects - if (!($code = $codes[$type])) - it::fatal("Invalid redirect type '$type', must be 'permanent' or 'temporary'"); + if (!($code = $codes[$type]) || !$url) + it::fatal("invalid redirect type or missing redirect url"); $url = preg_replace("/[\r\n].*/", '', it_url::absolute($url)); # Security: cut after CR/LF -- cgit v1.2.3