ID: 49611 User updated by: d dot reade at readesresidential dot com Reported By: d dot reade at readesresidential dot com Status: Open Bug Type: Filesystem function related Operating System: CentOS 5.3 x86 PHP Version: 5.2.11 New Comment:
Just to clarify the header information is being automatically added to random images (not all) since PHP 5.2.11. I have seen a similar bug report, however my issue has occurred since installing PHP 5.2.11 today. Downgrading to PHP 5.2.10 fixes the problem and everything works as expected from that point on. Previous Comments: ------------------------------------------------------------------------ [2009-09-20 18:00:01] d dot reade at readesresidential dot com Description: ------------ Since PHP 5.2.11 various scripts we use that utilise the file_get_contents function have been including the file header info in the output. This doesn't happen all the time, but it's happening enough to break our scripts, as well as 3rd party scripts such as DOMPDF. This appears to be happening with any file type and was first noticed within minutes of installing PHP 5.2.11 today. We operate another server running 5.2.10. This uses the exact same configuration, extensions and web code, but has none of these problems. Reproduce code: --------------- <? $file = file_get_contents('image.jpg'); file_put_contents('newimage.jpg', $file); ?> Expected result: ---------------- newimage.jpg file containing exact contents of image.jpg Actual result: -------------- // start of newimage.jpg HTTP/1.1 200 OK Date: Sun, 20 Sep 2009 16:29:16 GMT Server: Apache Last-Modified: Sun, 20 Sep 2009 16:01:15 GMT Accept-Ranges: bytes Content-Length: 67648 Cache-Control: max-age=2592000 Expires: Tue, 20 Oct 2009 16:29:16 GMT Connection: close Content-Type: image/jpeg ���ï¿...@^pjfif^@^a...@^@^...@^a^@^...@��^@<CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 100 // followed by the rest of the code... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49611&edit=1