Fixed short URL character set. Added short URL shuffling code to help you shuffle the order.
This commit is contained in:
parent
b9501e3b0f
commit
c231e4badb
18
index.php
18
index.php
@ -11,8 +11,8 @@ class shortID {
|
|||||||
var $lowerCase = false;
|
var $lowerCase = false;
|
||||||
|
|
||||||
var $check = array(3, 20);
|
var $check = array(3, 20);
|
||||||
var $charactersAllCase = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@*-_=+,.;'|";
|
var $charactersAllCase = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_.";
|
||||||
var $charactersLowerCase = "abcdefghijklmnopqrstuvwxyz1234567890!@*-_=+,.;'|";
|
var $charactersLowerCase = "abcdefghijklmnopqrstuvwxyz1234567890-_.";
|
||||||
var $alphabet = array();
|
var $alphabet = array();
|
||||||
var $base = 0;
|
var $base = 0;
|
||||||
|
|
||||||
@ -83,8 +83,6 @@ class shortID {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
header("Content-Type: application/json");
|
|
||||||
|
|
||||||
$_CS = array();
|
$_CS = array();
|
||||||
$_CS['version'] = "0.4";
|
$_CS['version'] = "0.4";
|
||||||
$_CS['time'] = time();
|
$_CS['time'] = time();
|
||||||
@ -114,6 +112,15 @@ exit();
|
|||||||
// End of MD5 code.
|
// 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['domain'] = $_SERVER['HTTP_HOST'];
|
||||||
$_CS['port'] = $_SERVER['SERVER_PORT'];
|
$_CS['port'] = $_SERVER['SERVER_PORT'];
|
||||||
$_CS['ssl'] = ($_SERVER['HTTPS']=="on");
|
$_CS['ssl'] = ($_SERVER['HTTPS']=="on");
|
||||||
@ -145,6 +152,9 @@ if (!empty($_COOKIE["{$_CS['cookiePrefix']}user"])) {
|
|||||||
$_CS['loggedIn'] = true;
|
$_CS['loggedIn'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
|
||||||
$response = array();
|
$response = array();
|
||||||
$response["version"] = $_CS['version'];
|
$response["version"] = $_CS['version'];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user