diff options
author | Urban Müller | 2015-11-17 15:46:05 +0100 |
---|---|---|
committer | Urban Müller | 2015-11-17 15:46:05 +0100 |
commit | 791239bfb548b7524c309e7c6c522165875ae4ea (patch) | |
tree | b9028534fa069391d19f3f5ef9aea662f063c88e | |
parent | 3b4aeabd9186666e025d3233f06f7458356bfc37 (diff) | |
download | itools-791239bfb548b7524c309e7c6c522165875ae4ea.tar.gz itools-791239bfb548b7524c309e7c6c522165875ae4ea.tar.bz2 itools-791239bfb548b7524c309e7c6c522165875ae4ea.zip |
report empty redir urls, they cause loops
-rw-r--r-- | it_url.class | 4 |
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 |