bcit-ci / CodeIgniter

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
18.26k stars 7.6k forks source link

File renaming fail on upload #26

Closed bitbucket-import closed 12 years ago

bitbucket-import commented 13 years ago

Hi, if i upload the same file more than 100 times codeigniter fail to rename it and raise an error. The problem is in this loop {{{

!php

$new_filename = ''; for ($i = 1; $i < 100; $i++) { if ( ! file_exists($path.$filename.$i.$this->file_ext)) { $new_filename = $filename.$i.$this->file_ext; break; } }

}}}

in the upload library… It could seem a silly problem but if you give to the end user some template files to upload you could have some problems…

bye Luca

ollydcuk commented 10 years ago

This caught us out recently. Any chance of the fix being merged into master?