mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Change name when file name contains more of a point MDL-6897 - patch submitted by Toni Mas; merged from MOODLE_17_STABLE
This commit is contained in:
parent
1a1f496681
commit
3c0f610636
@ -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'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user