Fixed error with blank urls causing infinite loop

This commit is contained in:
alopexc0de 2012-10-07 23:01:01 -04:00
parent 324b422975
commit c6199a77c6

View File

@ -21,7 +21,7 @@ if(!$_POST['submit'])
$dest=$_POST['dest']; $dest=$_POST['dest'];
if($_POST["submit"]) if($_POST["submit"])
{ {
if(isset($_POST['dest'])) if(isset($_POST['dest']) && $dest != "")
{ {
$myFile = $random.".html"; $myFile = $random.".html";
$fh = fopen($myFile, 'w') or die("can't open file"); $fh = fopen($myFile, 'w') or die("can't open file");
@ -47,6 +47,14 @@ your link is available here:<br>
<a href="http://unps-gama.tk">Home</a> <a href="http://unps-gama.tk">Home</a>
'; ';
}if($dest == ""){
echo '
Sorry, you are not able to shorten something without a url <br>
<a href="index.php">Back to index</a><br>
<a href="http://unps-gama.tk">Home</a>
';
} }
} }