]> jfr.im git - uguu.git/blobdiff - static/php/upload.php
Merge branch 'master' of https://github.com/nokonoko/Uguu
[uguu.git] / static / php / upload.php
index 3a9b0f9af0984cdf00e4b485d1c0d9958e905300..27ff3e37f2c39e956959c6b3739d55e6dec13273 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Uguu
  *
- * @copyright Copyright (c) 2022 Go Johansson (nekunekus) <neku@pomf.se> <github.com/nokonoko>
+ * @copyright Copyright (c) 2022 Go Johansson (nokonoko) <neku@pomf.se>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,9 +28,11 @@ if (isset($_FILES['files'])) {
 
     try {
         foreach ($uploads as $upload) {
-            $res[] = (new Upload())->uploadFile($upload);
+            $res[] = (new Upload())->uploadFile();
+        }
+        if (isset($res)) {
+            $response->send($res);
         }
-        $response->send($res);
     } catch (Exception $e) {
         $response->error($e->getCode(), $e->getMessage());
     }