ID:               49611
 User updated by:  d dot reade at readesresidential dot com
 Reported By:      d dot reade at readesresidential dot com
 Status:           Bogus
 Bug Type:         Filesystem function related
 Operating System: CentOS 5.3 x86
 PHP Version:      5.2.11
 New Comment:

Ah fair play, sorry for the confusion. It was an example of what
functions I was using. The real code uses http:// to fetch the required
image.


Previous Comments:
------------------------------------------------------------------------

[2009-09-20 20:50:53] ras...@php.net

The thing that doesn't make sense in your bug report is that your
reproduce code just says:

$file = file_get_contents('image.jpg');
file_put_contents('newimage.jpg', $file);

There is no HTTP involved here, so where would the HTTP headers come
from?  


------------------------------------------------------------------------

[2009-09-20 20:28:08] d dot reade at readesresidential dot com

But the problem stops occurring as soon as I downgrade to PHP 5.2.10.
No changes are being made to any configuration or extensions either.

------------------------------------------------------------------------

[2009-09-20 19:55:17] paj...@php.net

Can't reproduce on many servers/platforms. Double check your script or
config, something could be wrong.

------------------------------------------------------------------------

[2009-09-20 18:04:39] d dot reade at readesresidential dot com

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.

------------------------------------------------------------------------

[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

Reply via email to