From 8112bfa43ecfdb077908186fa97ab534084712bf Mon Sep 17 00:00:00 2001 From: alopexc0de Date: Wed, 7 May 2014 19:17:13 -0500 Subject: [PATCH] Remove forward slashes This is to hopefully be able to process unps.us/linkid instead of unps.us/?linkid --- index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.php b/index.php index 1b0ba4d..7b65e0a 100644 --- a/index.php +++ b/index.php @@ -17,6 +17,7 @@ if(!empty($_GET['l'])){ include('api/dbsettings.php'); $link = $shortdb->real_escape_string(strtolower(stripslashes(strip_tags($_GET['l'])))); + $link = str_replace('/', '', $link); $sql = "SELECT * FROM `links` WHERE `shortlink` = '$link' LIMIT 1;"; if($result = $shortdb->query($sql)){ if($row = $result->fetch_assoc()){ @@ -32,6 +33,7 @@ $key = key($_GET); include('api/dbsettings.php'); $link = $shortdb->real_escape_string(strtolower(stripslashes(strip_tags($key)))); + $link = str_replace('/', '', $link); $sql = "SELECT * FROM `links` WHERE `shortlink` = '$link' LIMIT 1;"; if($result = $shortdb->query($sql)){ if($row = $result->fetch_assoc()){