Kai Hendry
2015-10-10 17:00:07 +08:00
parent 28fcec43f2
commit ce54e4c0f1
2 changed files with 14 additions and 12 deletions

View File

@@ -2,8 +2,9 @@
if (preg_match('#^/u/#', $_SERVER["REQUEST_URI"])) {
$username = basename($_SERVER["REQUEST_URI"]);
if ((!empty($username)) && (strlen($username < 16)) && preg_match('/^[A-Za-z0-9_]+$/', $username)) {
header("Location:http://" . $_SERVER["HTTP_HOST"] . "/f/" . $username);
die();
header("HTTP/1.1 303 See Other");
header("Location:http://" . $_SERVER["HTTP_HOST"] . "/f/" . strtolower($username));
die();
}
}
?>