Passed
Pull Request — master (#20)
by
unknown
03:07 queued 01:13
created
upload/song.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     <body> 
13 13
         <?php require(__DIR__ . "/../important/header.php"); 
14 14
         
15
-        if(@$_POST['submit']) {
15
+        if (@$_POST['submit']) {
16 16
             $register = require(__DIR__ . "/../func/upload.php");
17 17
             $register("song", ["ogg", "mp3"]);
18 18
         }
Please login to merge, or discard this patch.
upload/chiptune.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     <body> 
13 13
         <?php require(__DIR__ . "/../important/header.php"); 
14 14
         
15
-        if(@$_POST['submit']) {
15
+        if (@$_POST['submit']) {
16 16
             $register = require(__DIR__ . "/../func/upload.php");
17 17
             $register("chiptune", ["xm", "mod", "s3m", "it"]);
18 18
         }
Please login to merge, or discard this patch.
func/upload.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 require(__DIR__ . "/conn.php"); 
4 4
 
5 5
 return function($type, $allowedFileTypes) {
6
-    if(isset($_SESSION['user'])) {
6
+    if (isset($_SESSION['user'])) {
7 7
         $fileType = strtolower(pathinfo($_FILES["fileToUpload"]["name"], PATHINFO_EXTENSION));
8 8
         $target_dir = __DIR__ . "/../dynamic/" . $type . "/";
9 9
         $target_name = md5_file($_FILES["fileToUpload"]["tmp_name"]) . "." . $fileType;
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
             $movedFile = move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file);
19 19
         }
20 20
 
21
-        if(!in_array($fileType, $allowedFileTypes)) {
21
+        if (!in_array($fileType, $allowedFileTypes)) {
22 22
             echo 'unsupported file type. must be one of ' . join(", ", $allowedFileTypes) . '<hr>';
23 23
             $uploadOk = 0;
24 24
         }
Please login to merge, or discard this patch.