From c231e4badbcef5533b391d77a6c3b7cd6d650e2f Mon Sep 17 00:00:00 2001 From: GRMrGecko Date: Tue, 17 Nov 2015 11:53:35 -0600 Subject: [PATCH] Fixed short URL character set. Added short URL shuffling code to help you shuffle the order. --- index.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index accc2f7..1060951 100644 --- a/index.php +++ b/index.php @@ -11,8 +11,8 @@ class shortID { var $lowerCase = false; var $check = array(3, 20); - var $charactersAllCase = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@*-_=+,.;'|"; - var $charactersLowerCase = "abcdefghijklmnopqrstuvwxyz1234567890!@*-_=+,.;'|"; + var $charactersAllCase = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_."; + var $charactersLowerCase = "abcdefghijklmnopqrstuvwxyz1234567890-_."; var $alphabet = array(); var $base = 0; @@ -83,8 +83,6 @@ class shortID { } } -header("Content-Type: application/json"); - $_CS = array(); $_CS['version'] = "0.4"; $_CS['time'] = time(); @@ -114,6 +112,15 @@ exit(); // End of MD5 code. */ +/* +// Beginning of short URL shuffling. +header("Content-Type: text/plain"); +$shortID = new shortID(); +echo "All case: "$shortID->shuffleAlphabet()."\n"; +echo "Lower case: "$shortID->shuffleAlphabet(true)."\n"; +exit(); +*/ + $_CS['domain'] = $_SERVER['HTTP_HOST']; $_CS['port'] = $_SERVER['SERVER_PORT']; $_CS['ssl'] = ($_SERVER['HTTPS']=="on"); @@ -145,6 +152,9 @@ if (!empty($_COOKIE["{$_CS['cookiePrefix']}user"])) { $_CS['loggedIn'] = true; } + +header("Content-Type: application/json"); + $response = array(); $response["version"] = $_CS['version'];