mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/11044] Preserve the file extension in unique filenames
PHPBB3-11044
This commit is contained in:
parent
3390712ed7
commit
011b494bc5
1 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue