summaryrefslogtreecommitdiff
path: root/ext/zip
diff options
context:
space:
mode:
authorAnatoliy Belsky <ab@php.net>2012-06-17 16:10:56 +0200
committerAnatoliy Belsky <ab@php.net>2012-06-17 16:10:56 +0200
commitc56ff2bf7592f3ceaafe71cc5b93340e8226cf6e (patch)
tree8849ff04230b8a70a99134c9875195bf99cc1462 /ext/zip
parent11a202ef50fdcd92b5cc3b3e1d5a739cd85b7541 (diff)
parentd3780f1f903e6cee4bb2ff723aa36a5cd1824c08 (diff)
downloadphp-git-c56ff2bf7592f3ceaafe71cc5b93340e8226cf6e.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: Reverted the BC fix regarding to #57905, test adopted
Diffstat (limited to 'ext/zip')
-rw-r--r--ext/zip/lib/zip_open.c12
-rw-r--r--ext/zip/tests/pecl12414.phpt3
2 files changed, 3 insertions, 12 deletions
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
index a348d9800d..2f56881b0a 100644
--- a/ext/zip/lib/zip_open.c
+++ b/ext/zip/lib/zip_open.c
@@ -206,9 +206,7 @@ _zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, unsigned char *eoc
cd->comment = NULL;
cd->comment_len = _zip_read2(&cdp);
- /* without checking the ZIP_CHECKCONS flag we'll not able even to open inconsistent
- archives at this place, which would break bc in PHP */
- if ((ZIP_CHECKCONS == (flags & ZIP_CHECKCONS)) && ((zip_uint64_t)cd->offset)+cd->size > buf_offset + (eocd-buf)) {
+ if (((zip_uint64_t)cd->offset)+cd->size > buf_offset + (eocd-buf)) {
/* cdir spans past EOCD record */
_zip_error_set(error, ZIP_ER_INCONS, 0);
cd->nentry = 0;
@@ -239,13 +237,7 @@ _zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, unsigned char *eoc
}
}
- /* the first if branch goes the old way of libzip 0.9 so we don't loose
- the bc for reading inconsistent files */
- if ((ZIP_CHECKCONS != (flags & ZIP_CHECKCONS)) && cd->size < (unsigned int)(eocd-buf)) {
- cdp = eocd - cd->size;
- bufp = &cdp;
- }
- else if (cd->offset >= buf_offset) {
+ if (cd->offset >= buf_offset) {
/* if buffer already read in, use it */
cdp = buf + (cd->offset - buf_offset);
bufp = &cdp;
diff --git a/ext/zip/tests/pecl12414.phpt b/ext/zip/tests/pecl12414.phpt
index ab11d21a63..61546386ab 100644
--- a/ext/zip/tests/pecl12414.phpt
+++ b/ext/zip/tests/pecl12414.phpt
@@ -35,5 +35,4 @@ if ($res === TRUE) {
?>
--DONE--
--EXPECTF--
-ZIP contents size: %d
-zip_readfile recorded data does not match unpacked size: %specl12414.zip : MYLOGOV2.GFX
+zip_readfile could not read from %specl12414.zip : MYLOGOV2.GFX