Passed
Pull Request — Showing-Posts (#54)
by Stone
01:57
created
App/Controllers/Ajax/ImageUpload.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
     private function getFilename(string $folder, string $file): string
44 44
     {
45 45
 
46
-        $fileUrl = $folder . $file;
46
+        $fileUrl = $folder.$file;
47 47
         $docRoot = $this->request->getDocumentRoot();
48
-        $filePath = $docRoot . "/public/" . $fileUrl;
48
+        $filePath = $docRoot."/public/".$fileUrl;
49 49
         if (file_exists($filePath) !== 1) {
50 50
             $fileNum = 0;
51 51
             while (file_exists($filePath)) {
52
-                $fileUrl = $folder . $fileNum . "_" . $file;
53
-                $filePath = $docRoot . "/public/" . $fileUrl;
52
+                $fileUrl = $folder.$fileNum."_".$file;
53
+                $filePath = $docRoot."/public/".$fileUrl;
54 54
                 $fileNum += 1;
55 55
             }
56 56
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
             // Respond to the successful upload with JSON.
76 76
             echo json_encode(array('location' => $filetowrite));
77
-        } else {
77
+        }else {
78 78
             // Notify editor that the upload failed
79 79
             echo json_encode(array('error' => 'Upload failed, file might be too big'));
80 80
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
             // Respond to the successful upload with JSON.
110 110
             echo json_encode(array('location' => $filetowrite));
111
-        } else {
111
+        }else {
112 112
             // Notify editor that the upload failed
113 113
             header("HTTP/1.1 500 Server Error");
114 114
         }
Please login to merge, or discard this patch.