mirror of
https://github.com/gamaio/unps.us-Shortener.git
synced 2025-07-30 13:50:17 +00:00
Broke the shortener
I broke everything.
This commit is contained in:
@@ -5,10 +5,6 @@
|
||||
$catchid = $catches[0];
|
||||
$catchVal = $catches[1];
|
||||
|
||||
if(empty($_GET['token']) || $_GET['token'] != $_SESSION['token'] || empty($_POST[$catchid]) || $_POST[$catchid] != $catchVal){
|
||||
die("<div id=\"error\">Oh Noes! Something happened and I can't continue.<br />Please try again by using the form located at <a href=\"http://unps.us\">http://unps.us</a>.</div>");
|
||||
}
|
||||
|
||||
require('api/api.backend.php');
|
||||
require('api/dbsettings.php');
|
||||
|
||||
@@ -24,13 +20,16 @@
|
||||
$unpsAPI = new api();
|
||||
|
||||
if(!empty($_POST['link']) && !empty($_POST['linkmod'])){
|
||||
if(empty($_GET['token']) || $_GET['token'] != $_SESSION['token'] || empty($_POST[$catchid]) || $_POST[$catchid] != $catchVal){
|
||||
die("<div id=\"error\">Oh Noes! Something happened and I can't continue.<br />Please try again by using the form located at <a href=\"http://unps.us\">http://unps.us</a>.</div>");
|
||||
}
|
||||
switch ($_POST['linkmod']){
|
||||
case "shorten":
|
||||
$short = sanitize($_POST['link']);
|
||||
if(strpos($short, "http://") === false && strpos($short, "https://") === false){
|
||||
$short = "http://$short";
|
||||
}
|
||||
echo $unpsAPI->shorten($apidb, $key, $shortdb, $short);
|
||||
echo $unpsAPI->shorten($short);
|
||||
break;
|
||||
default:
|
||||
die("<div id=\"error\">I don't know what you want to do... [-Check linkmod-]</div>");
|
||||
|
Reference in New Issue
Block a user