mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
ZipArchive::open(): Using empty file as ZipArchive is deprecated
This commit is contained in:
parent
217ff8132e
commit
a4d12f46d1
@ -457,6 +457,11 @@ PHP 8.0 UPGRADE NOTES
|
|||||||
4. Deprecated Functionality
|
4. Deprecated Functionality
|
||||||
========================================
|
========================================
|
||||||
|
|
||||||
|
- Zip:
|
||||||
|
. Using empty file as ZipArchive is deprecated. Libzip 1.6.0
|
||||||
|
do not accept empty files as valid zip archives any longer.
|
||||||
|
Existing workaround will be removed in next version.
|
||||||
|
|
||||||
========================================
|
========================================
|
||||||
5. Changed Functions
|
5. Changed Functions
|
||||||
========================================
|
========================================
|
||||||
|
@ -1487,7 +1487,6 @@ static ZIPARCHIVE_METHOD(open)
|
|||||||
ze_obj->filename = NULL;
|
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
|
/* reduce BC break introduce in libzip 1.6.0
|
||||||
"Do not accept empty files as valid zip archives any longer" */
|
"Do not accept empty files as valid zip archives any longer" */
|
||||||
|
|
||||||
@ -1497,10 +1496,10 @@ static ZIPARCHIVE_METHOD(open)
|
|||||||
|
|
||||||
/* exists and is empty */
|
/* exists and is empty */
|
||||||
if (VCWD_STAT(resolved_path, &st) == 0 && st.st_size == 0) {
|
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;
|
flags |= ZIP_TRUNCATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
intern = zip_open(resolved_path, flags, &err);
|
intern = zip_open(resolved_path, flags, &err);
|
||||||
if (!intern || err) {
|
if (!intern || err) {
|
||||||
|
@ -20,5 +20,6 @@ $nx->statName("a",ZIPARCHIVE::FL_UNCHANGED);
|
|||||||
$fname = __DIR__."/test53885.zip";
|
$fname = __DIR__."/test53885.zip";
|
||||||
unlink($fname);
|
unlink($fname);
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECTF--
|
||||||
|
Deprecated: ZipArchive::open(): Using empty file as ZipArchive is deprecated in %s
|
||||||
==DONE==
|
==DONE==
|
||||||
|
Loading…
Reference in New Issue
Block a user