image helper bug
Posted: Mon Aug 17, 2009 12:52 pm
In the image helper class there is a check at the top:
The problem is that even if $filename = "", that will still return true and try to resize a nameless image and throw an error:
file_exists sees that the DIR_IMAGE path exists and that is enough to pass as TRUE as stated in the php manual:
Code: Select all
if (!file_exists(DIR_IMAGE . $filename)) {
return;
}
Code: Select all
<b>Warning</b>: getimagesize(D:\EasyWAMP\www\v132/image/) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: Permission denied in <b>D:\EasyWAMP\www\v132\system\library\image.php</b> on line <b>11</b><br />
This should work better:Returns TRUE if the file or directory specified by filename exists; FALSE otherwise.
Code: Select all
if ($filename == "" || !file_exists(DIR_IMAGE . $filename)) {
return;
}