summaryrefslogtreecommitdiff
path: root/ext/phar
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-09-22 01:39:11 +0000
committerGreg Beaver <cellog@php.net>2008-09-22 01:39:11 +0000
commit498ffbc84f277da8367cd25dfd10e15612561c6f (patch)
tree107dfcd7396ae3c4b4ecf651aaecf425e4bcdcb3 /ext/phar
parent17cfd5f24e2d73f74472a1f27e4e69ee8bea3f12 (diff)
downloadphp-git-498ffbc84f277da8367cd25dfd10e15612561c6f.tar.gz
workaround for Bug #46147 for PHP < 5.2.7
Diffstat (limited to 'ext/phar')
-rw-r--r--ext/phar/zip.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index a685d995da..221a806f55 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -484,6 +484,10 @@ foundit:
/* construct actual offset to file start - local extra_len can be different from central extra_len */
entry.offset = entry.offset_abs =
sizeof(local) + entry.header_offset + PHAR_GET_16(local.filename_len) + PHAR_GET_16(local.extra_len);
+#if PHP_VERSION_ID < 50207
+ /* work around Bug #46147 */
+ fp->writepos = fp->readpos = 0;
+#endif
php_stream_seek(fp, entry.offset, SEEK_SET);
mydata->alias_len = entry.uncompressed_filesize;