Bug #70315 [NEW]: imagecreatefromstring() returns 500 Server Error but page full renderized

From: Date: Thu, 20 Aug 2015 19:24:50 +0000
Subject: Bug #70315 [NEW]: imagecreatefromstring() returns 500 Server Error but page full renderized
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195378@lists.php.net to get a copy of this message
From: patriciotarantino at gmail dot com Operating system: Ubuntu PHP version: 5.6.12 Package: GD related Bug Type: Bug Bug description:imagecreatefromstring() returns 500 Server Error but page full renderized Description: ------------ Condition: display_errors is off. If you use imagecreatefromstring() with an invalid string, it returns a 500 Internal Server Error in the HTTP headers, but the page is fully renderized. It should return 200 OK (and the full page), or a 500 Error but without the full HTML. Not both at the same time. 5.3.10 and 5.4.44 are not affected. 5.5.9 and 5.6.12 are affected. Test script: --------------- <?php ini_set("display_errors", 0); $data = "iVBORw0KGgoAAAANSUhEUgAAAuwAAAUeCAYAAAAl3WR...LkAAAAAElFTkSuQmCC"; $data = base64_decode($data); $im = imagecreatefromstring($data); echo "This should not render"; -- Edit bug report at https://bugs.php.net/bug.php?id=70315&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70315&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70315&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70315&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70315&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70315&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70315&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70315&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70315&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70315&r=support Expected behavior: https://bugs.php.net/fix.php?id=70315&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70315&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70315&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70315&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70315&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70315&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70315&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70315&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70315&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70315&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70315&r=mysqlcfg

« previous php.bugs (#195378) next »