@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | $extension = isset($fileParts['extension']) ? ('.'.$fileParts['extension']) : ''; |
| 41 | 41 | |
| 42 | 42 | // Look to see if a number is already appended to a file. (example - file(1).pdf) |
| 43 | - if(preg_match('/(.*?)(\d+)$/', $fileParts['filename'], $match)) |
|
| 43 | + if(preg_match('/(.*?)(\d+)$/', $fileParts['filename'], $match)) |
|
| 44 | 44 | { |
| 45 | 45 | // Has a number, increment it |
| 46 | 46 | $base = $match[1]; |
| 47 | 47 | $number = intVal($match[2]); |
| 48 | - } |
|
| 49 | - else |
|
| 48 | + } |
|
| 49 | + else |
|
| 50 | 50 | { |
| 51 | 51 | // No number, add one |
| 52 | 52 | $base = $fileParts['filename']; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // Increase the number until one that is not in use is found |
| 57 | - do |
|
| 57 | + do |
|
| 58 | 58 | { |
| 59 | 59 | $fileName = $base.'('.++$number.')'.$extension; |
| 60 | 60 | } while(Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)); |