diff options
Diffstat (limited to 'it_url.class')
-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 |