functions_images.inc rename

Found a bug? Tell us!!
Post Reply
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

functions_images.inc rename

Post by Timbalu »

Hi Garvin

I just wanted to move a media library (zip) file from root /uploads to /uploads/test and/or way back. On the way passing, there are some small and quickly vanishing warnings about the PHP rename function in line 3420 and 3425.
I tried to debug these and found we could silence them by @ but not solve the real problem.
They say that the file(s) can't be found, which is true, while it is already done in 3367 and 3371.
The problem occurs by not strictly seperating $type == 'file' and $type == 'filedir', I think.
It may be solved by adding file_exists($oldfile)

Code: Select all

} elseif ($type == 'filedir' && file_exists($oldfile)) {
.

Regards,
Ian
Last edited by Timbalu on Tue Jan 25, 2011 11:56 am, edited 1 time in total.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: functions_images.inc rename

Post by Timbalu »

bump, this could save some performance pennies...

Did I miss something?

Edit: Answer to myself :: Yes! Silencing is the better way. :wink:
Post Reply