summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
authorUrban Müller2015-11-17 15:46:05 +0100
committerUrban Müller2015-11-17 15:46:05 +0100
commit791239bfb548b7524c309e7c6c522165875ae4ea (patch)
treeb9028534fa069391d19f3f5ef9aea662f063c88e /it_url.class
parent3b4aeabd9186666e025d3233f06f7458356bfc37 (diff)
downloaditools-791239bfb548b7524c309e7c6c522165875ae4ea.tar.gz
itools-791239bfb548b7524c309e7c6c522165875ae4ea.tar.bz2
itools-791239bfb548b7524c309e7c6c522165875ae4ea.zip
report empty redir urls, they cause loops
Diffstat (limited to 'it_url.class')
-rw-r--r--it_url.class4
1 files 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