diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/upload.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/upload.php b/scripts/upload.php index 10669085..5401b722 100644 --- a/scripts/upload.php +++ b/scripts/upload.php @@ -376,8 +376,10 @@ function UploadVerifyBasic($pagename,$uploadfile,&$filepath,&$upname=null) { } } if (IsEnabled($EnableUploadVersions, 0)==2 && file_exists($filepath)) { - if(preg_match('!^(.*)(\\.[a-z0-9]+)$!i', $filepath, $m)) { - $filepath = $m[1] . '-' . base_convert($Now, 10, 36) . $m[2]; + if(preg_match('!^(.*/([^/]+))(\\.[a-z0-9]+)$!i', $filepath, $m)) { + $stamp36 = base_convert($Now, 10, 36); + $filepath = "{$m[1]}-$stamp36{$m[3]}"; + $upname = "{$m[2]}-$stamp36{$m[3]}"; } } if (!$EnableUploadOverwrite && file_exists($filepath)) |