diff --git a/api.php b/api.php index ad5fc5d..89151ba 100644 --- a/api.php +++ b/api.php @@ -5,9 +5,11 @@ if(isset($_GET['d'])) { include_once('includes/core.php'); switch ($_GET['d']) { case 'upload': - //If no file is being posted, exit + //If no file is being posted, show the error page and exit. if(empty($_FILES['file']['name'])){ - exit('You fucked up, nothing to do.');} + include('error.php'); + exit(0); + } //Set the name value to the original filename $name = $_FILES['file']['name']; $arg = 'custom_original'; diff --git a/error.php b/error.php new file mode 100644 index 0000000..fd23956 --- /dev/null +++ b/error.php @@ -0,0 +1,18 @@ +assign("title", $title); +$tpl->draw("header"); +$tpl->draw("error"); + + +$tpl->draw("footer"); +?> \ No newline at end of file diff --git a/rain/cache/error.e1ac13855adfa478d8926be2da304459.rtpl.php b/rain/cache/error.e1ac13855adfa478d8926be2da304459.rtpl.php new file mode 100644 index 0000000..c7beb37 --- /dev/null +++ b/rain/cache/error.e1ac13855adfa478d8926be2da304459.rtpl.php @@ -0,0 +1,12 @@ +
Ooops! It seems something has went wrong! Make sure you've selected a file for upload :^)
+