Passed
Push — Showing-Posts ( f20f00...822ae4 )
by Stone
02:31
created
App/Controllers/Ajax/ImageUpload.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  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 48
         $filePath = $docRoot."/public/".$fileUrl;
49
-        if(file_exists($filePath) !== 1)
49
+        if (file_exists($filePath) !== 1)
50 50
         {
51 51
             $fileNum = 0;
52
-            while(file_exists($filePath))
52
+            while (file_exists($filePath))
53 53
             {
54 54
                 $fileUrl = $folder.$fileNum."_".$file;
55 55
                 $filePath = $docRoot."/public/".$fileUrl;
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
             // Respond to the successful upload with JSON.
78 78
             echo json_encode(array('location' => $filetowrite));
79
-        } else {
79
+        }else {
80 80
             // Notify editor that the upload failed
81 81
             echo json_encode(array('error' => 'Upload failed, file might be too big'));
82 82
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
             // Respond to the successful upload with JSON.
112 112
             echo json_encode(array('location' => $filetowrite));
113
-        } else {
113
+        }else {
114 114
             // Notify editor that the upload failed
115 115
             header("HTTP/1.1 500 Server Error");
116 116
         }
Please login to merge, or discard this patch.