Fixed faulty redirect

This commit is contained in:
Nicolas A. Tonne
2015-02-13 12:10:26 +01:00
parent 96b02b10e5
commit 617a2b96d1
2 changed files with 3 additions and 3 deletions

View File

@@ -1,9 +1,9 @@
<?php
if(isset($_GET['chan'])) header('Location: '.$_GET['chan']);
if(isset($_GET['chan'])) {header('Location: '.$_GET['chan']); exit;}
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
if($list[1]==""||!isset($list[1])||count($list)<=1){$list="";include('php/nochan.php');die();}
else if ($list[1] != preg_replace('/[^\da-z]/i', '', urldecode($list[1]))){
header('Location: ../'.preg_replace('/[^\da-z]/i', '', urldecode($list[1])));
header('Location: ../'.preg_replace('/[^\da-z?=]/i', '', urldecode($list[1])));
exit;
}
else $list=$list[1];