php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46577 gzip functions don't read/write mtime header
Submitted: 2008-11-15 11:34 UTC Modified: 2011-04-08 18:23 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: mmj048 at gmail dot com Assigned:
Status: Open Package: Zlib related
PHP Version: 5.2.6 OS: Windows Vista
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-11-15 11:34 UTC] mmj048 at gmail dot com
Description:
------------
The gzencode and gzwrite functions, which implement RFC 1952 (http://www.gzip.org/zlib/rfc-gzip.html), don't read/write the mtime header.
While this is not necessary for gzip compliance (http://www.gzip.org/zlib/rfc-gzip.html#id-compliance) adding a function to read/write the mtime header when compressing or reading compressed files would be very useful in many cases.

I currently use custom code to read/write the gzip mtime header.

Read:

$gzmtime = end(unpack('V', file_get_contents($gzfile, null, null, 4, 4)));

Write:

$r = fopen($gzfile, 'r+');
fseek($r, 4);
fwrite($r, pack('V', $filemtime), 4);
fclose($r);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-08 18:23 UTC] jani@php.net
-Package: Feature/Change Request +Package: Zlib related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 14:01:26 2019 UTC