@@ -43,13 +43,13 @@ discard block |
||
| 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 |
||
| 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')); |
| 82 | 82 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | // Respond to the successful upload with JSON. |
| 111 | 111 | echo json_encode(array('location' => $filetowrite)); |
| 112 | - } else { |
|
| 112 | + }else { |
|
| 113 | 113 | // Notify editor that the upload failed |
| 114 | 114 | header("HTTP/1.1 500 Server Error"); |
| 115 | 115 | } |