Bug #13386 Updated: problem supressing errors by '@' and including files

From: Date: Sat, 05 Jan 2002 21:48:07 +0000
Subject: Bug #13386 Updated: problem supressing errors by '@' and including files
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-75982@lists.php.net to get a copy of this message
ID: 13386 Updated by: lobbin Reported By: kapp@bigping.de Old Status: Feedback Status: Closed Bug Type: Scripting Engine problem Operating System: SuSE Linux 7.1 PHP Version: 4.0.6 New Comment: No feedback. Closing. Previous Comments: ------------------------------------------------------------------------ [2001-12-14 14:25:50] yohgaki@php.net Is your problem is too much error message for getimagesize()? If you write too much, chances are high that is ignored. Please try to be precise. ------------------------------------------------------------------------ [2001-09-22 07:53:25] kapp@bigping.de Hi Folks! Pls. look at the following problem: I have a database application which returns me up to n datasets containing 40 data fields each. Every field can hold an URL to an image or anything else. To detect if it is an image, I check the image size (which I need anyway) and if the test returns TRUE, then it returns an anchor tag to the calling application. So far so good... It works fine until I have less than 13 sets. If I have more, the PHP parser returns a warning at every include() I use, telling me not beeing able to include the file. Very strange, isn't it? If I don't use the if ($img_size_array = @getimagesize ($image_dir.$input_array[$i]) to check if there's an image or not, the problem doesn't happen. It seems to be a problem of too much errors or warnings (supressed by the '@'). Maybe a stack overflow or something like this? This is the function I use: (p.s.: I already have a workaround, so the problem is not urgent) <? function get_img_tags($input_array) { include ("bcontent.php"); $img_tag = array(); for ($i = 0; $i <= count($input_array); $i++) { $img_sp1 = $img_space1; $img_sp2 = $img_space2; if (preg_match ("(\Apdf)", $input_array[$i])) { $img_tag[$i] = $img_sp1."<a href=\"".$image_url.$input_array[$i]."\" alt=\"".$input_array[$i+1]."\">".$input_array[$i+1]."</a>". $img_sp2; } else if ($img_size_array = @getimagesize ($image_dir.$input_array[$i])) { $img_tag[$i] = $img_sp1."<img src=\"".$image_url.$input_array[$i]."\" ".$img_size_array[3]." alt=\"".$input_array[$i+1]."\">".$img_sp2; } } return ($img_tag); } ?> Kind regards, Ulrich S. Kapp BIGPiNG! oHG Raamkamp 8 22397 Hamburg phone: 0049 40 608892-77 fax: 0049 40 608892-88 eMail: kapp@bigping.de ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13386&edit=1

« previous php.dev (#75982) next »