diff --git a/filesystem/File.php b/filesystem/File.php index a6a4f9f29..47fc95af8 100644 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -609,7 +609,7 @@ class File extends DataObject { // If it's changed, check for duplicates if($oldName && $oldName != $name) { - $base = pathinfo($name, PATHINFO_BASENAME); + $base = pathinfo($name, PATHINFO_FILENAME); $ext = self::get_file_extension($name); $suffix = 1; @@ -621,7 +621,7 @@ class File extends DataObject { ))->first() ) { $suffix++; - $name = "$base-$suffix$ext"; + $name = "$base-$suffix.$ext"; } }