Commit 06142736 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

When uploading files with only digits in the extension, append more digits on...

When uploading files with only digits in the extension, append more digits on clash rather than trying to preserve the extension
parent 85e48056
......@@ -692,7 +692,7 @@ abstract class ArtefactTypeFileBase extends ArtefactType {
*/
public static function get_new_file_title($desired, $parent, $owner, $group, $institution) {
$bits = split('\.', $desired);
if (count($bits) > 1) {
if (count($bits) > 1 && preg_match('/[^0-9]/', end($bits))) {
$start = join('.', array_slice($bits, 0, count($bits)-1));
$end = '.' . end($bits);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment