mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/11044] Preserve the file extension in unique filenames
PHPBB3-11044
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user