0
0

Corrected link forwarding check

This commit is contained in:
Bryan Pedini 2019-02-14 12:31:28 +01:00
parent 168f4ece75
commit 6cfbc1f7ea
No known key found for this signature in database
GPG Key ID: 688D440AE31B40C2

View File

@ -8,10 +8,10 @@
case "go":
if ( isset ( $request [ 1 ] ) ) {
$link_id = $request [ 1 ];
$link_id = (int) $link_id;
if ( ! is_int ( $link_id ) ) {
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;
$db_connection = db_connect ( );
$statement = db_prepare ( $db_connection, "SELECT links.URL FROM links WHERE links.ID = ?" );
$parameters = [