Page 1 of 1

functions_images.inc rename

Posted: Mon Jan 24, 2011 11:16 am
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

Re: functions_images.inc rename

Posted: Tue Jan 25, 2011 9:58 am
by Timbalu
bump, this could save some performance pennies...

Did I miss something?

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