0
0

Minor changes

Moved config into $GLOBALS
Moved request_uri into $GLOBALS
Modified all files accordingly
Modified logout page for future improvements (not deleting the entire $_SESSION)
Fixed LICENSEs, moved LICENSE for PHP files in /lib/php subfolder instead of /lib
This commit is contained in:
Bryan
2019-04-06 11:57:35 +02:00
parent 18dc9b18d3
commit 81d21c311f
11 changed files with 30 additions and 29 deletions

View File

@@ -1,11 +1,11 @@
<?php
if ( isset ( $request [ 1 ] ) ) {
$link_id = $request [ 1 ];
if ( isset ( $GLOBALS [ 'request_uri' ] [ 1 ] ) ) {
$link_id = $GLOBALS [ 'request_uri' ] [ 1 ];
if ( ! ctype_digit ( $link_id ) ) {
die ( "You can't be forwarded to a non numerical URL link ID. If you think this is incorrect, please send an email to shorte@dev.bryanpedini.it with this URL: https://sh.bjphoster.com/?go=" . $link_id . " for more investigations" );
}
$link_id = (int) $link_id;
$database = new Database ( $config [ 'db' ] );
$database = new Database ( $GLOBALS [ 'config' ] [ 'db' ] );
$database->connect ( );
$database->prepare ( "SELECT links.URL FROM links WHERE links.ID = ?" );
$parameters = [
@@ -18,7 +18,7 @@
$row = $result->fetch_assoc ( );
if ( ! $row ) {
http_response_code ( 404 );
include ( $config [ 'installation_path' ] . '/lib/errors/404.html' );
include ( $GLOBALS [ 'config' ] [ 'installation_path' ] . '/lib/errors/404.html' );
exit;
}
else {
@@ -55,4 +55,3 @@
else {
header ( "Location: " . substr ( $_SERVER [ 'SCRIPT_NAME' ], 0, -10 ) );
}
?>