You've already forked OpenShorte.old
Added licensing, redirected null /go requests to homepage, corrected 404 errors.
This commit is contained in:
@@ -23,13 +23,18 @@
|
||||
$result = $statement->get_result ( );
|
||||
$row = $result->fetch_assoc ( );
|
||||
if ( ! $row ) {
|
||||
http_response_code ( 404 );
|
||||
include ( 'errors/404.html' );
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
include ( 'templates/redirect.html' );
|
||||
echo ( '<script>var my_location = "' . $row [ 'URL' ] . '";</script>' );
|
||||
}
|
||||
}
|
||||
else {
|
||||
header ( "Location: " . substr ( $_SERVER [ 'SCRIPT_NAME' ], 0, -10 ) );
|
||||
}
|
||||
break;
|
||||
case "login":
|
||||
if ( isset ( $_SESSION [ 'user_id' ] ) ) {
|
||||
@@ -113,7 +118,7 @@
|
||||
break;
|
||||
default:
|
||||
http_response_code ( 404 );
|
||||
echo "fuck, 404!";
|
||||
include ( 'errors/404.html' );
|
||||
die ( );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user