summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2020-03-20 11:27:42 +0100
committerRemi Collet <remi@php.net>2020-03-20 11:27:42 +0100
commita4d12f46d1233da4f3518d918c925362b1d9465a (patch)
tree8abec6a2e46111654caf481daf2c3917c6ad5963 /ext/zip/php_zip.c
parent217ff8132e7bc5702a1f65d7f8fa3d7c28df8e9f (diff)
downloadphp-git-a4d12f46d1233da4f3518d918c925362b1d9465a.tar.gz
ZipArchive::open(): Using empty file as ZipArchive is deprecated
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index fb9d3aefec..2a3537a8ca 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1487,7 +1487,6 @@ static ZIPARCHIVE_METHOD(open)
ze_obj->filename = NULL;
}
-#if LIBZIP_VERSION_MAJOR > 1 || LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR >= 6
/* reduce BC break introduce in libzip 1.6.0
"Do not accept empty files as valid zip archives any longer" */
@@ -1497,10 +1496,10 @@ static ZIPARCHIVE_METHOD(open)
/* exists and is empty */
if (VCWD_STAT(resolved_path, &st) == 0 && st.st_size == 0) {
+ php_error_docref(NULL, E_DEPRECATED, "Using empty file as ZipArchive is deprecated");
flags |= ZIP_TRUNCATE;
}
}
-#endif
intern = zip_open(resolved_path, flags, &err);
if (!intern || err) {