From 3c0f6106368480b0c94de29365c9f0cf932937ea Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 31 Oct 2006 10:16:26 +0000 Subject: [PATCH] Change name when file name contains more of a point MDL-6897 - patch submitted by Toni Mas; merged from MOODLE_17_STABLE --- lib/uploadlib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/uploadlib.php b/lib/uploadlib.php index 2be27a8094..db6e4e2830 100644 --- a/lib/uploadlib.php +++ b/lib/uploadlib.php @@ -301,7 +301,10 @@ class upload_manager { * @todo verify return type - this function does not appear to return anything since $file is passed in by reference */ function handle_filename_collision($destination, &$file, $format='%s_%d.%s') { - $bits = explode('.', $file['name']); + $part1 = explode('.', $file['name']); + $bits = array(); + $bits[1] = array_pop($part1); + $bits[0] = implode('.', $part1); // check for collisions and append a nice numberydoo. if (file_exists($destination .'/'. $file['name'])) { $a->oldname = $file['name']; -- 2.39.5