1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 03:54:10 +01:00

[ticket/11044] Preserve the file extension in unique filenames

PHPBB3-11044
This commit is contained in:
Fyorl 2012-08-05 22:11:14 +01:00
parent 3390712ed7
commit 011b494bc5

View File

@ -138,8 +138,16 @@ class compress
{
if (isset($this->filelist[$name]))
{
$start = $name;
$ext = '';
$this->filelist[$name]++;
return $name . '.' . $this->filelist[$name];
if (($pos = strrpos($name, '.')) !== false) {
$start = substr($name, 0, $pos);
$ext = substr($name, $pos);
}
return $start . '_' . $this->filelist[$name] . $ext;
}
$this->filelist[$name] = 0;