Menu

#58 Image() Bug Found - I have the solution

open
nobody
None
5
2007-12-17
2007-12-17
Anonymous
No

Most calls to the Image() function use the following code to see if the given source path is an actual file:

$f_exists = @fopen($srcpath,"rb");
if (!$f_exists) //Show 'image not found' icon instead

This is a slow & antiquated method of checking to see if a file exists, and it's causing errors within HTML2PDF.

Simple Solution, use if_file() instead:

if (!is_file($srcpath)) //Show 'image not found' icon instead

Discussion


Log in to post a comment.

MongoDB Logo MongoDB