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 @@ +
+
+
+
+
+

Error!

+

Ooops! It seems something has went wrong! Make sure you've selected a file for upload :^)

+
+
+
+
+
\ No newline at end of file diff --git a/rain/cache/footer.e1ac13855adfa478d8926be2da304459.rtpl.php b/rain/cache/footer.e1ac13855adfa478d8926be2da304459.rtpl.php new file mode 100644 index 0000000..8fbe7ec --- /dev/null +++ b/rain/cache/footer.e1ac13855adfa478d8926be2da304459.rtpl.php @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/rain/cache/header.e1ac13855adfa478d8926be2da304459.rtpl.php b/rain/cache/header.e1ac13855adfa478d8926be2da304459.rtpl.php new file mode 100644 index 0000000..6b22197 --- /dev/null +++ b/rain/cache/header.e1ac13855adfa478d8926be2da304459.rtpl.php @@ -0,0 +1,41 @@ + + + + + + + + Uguu.se · <?php echo $title;?> + + + + + + + + + + + + diff --git a/rain/cache/upload.e1ac13855adfa478d8926be2da304459.rtpl.php b/rain/cache/upload.e1ac13855adfa478d8926be2da304459.rtpl.php new file mode 100644 index 0000000..a9ed4d2 --- /dev/null +++ b/rain/cache/upload.e1ac13855adfa478d8926be2da304459.rtpl.php @@ -0,0 +1,29 @@ +
+
+ +
+ +
+ File + +
+
+ +

+ + +

+ +
+
+ + +
+
+ + +
+ + diff --git a/rain/template/error.html b/rain/template/error.html new file mode 100644 index 0000000..4593592 --- /dev/null +++ b/rain/template/error.html @@ -0,0 +1,12 @@ +
+
+
+
+
+

Error!

+

Ooops! It seems something has went wrong! Make sure you've selected a file for upload :^)

+
+
+
+
+
\ No newline at end of file