File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -457,6 +457,11 @@ PHP 8.0 UPGRADE NOTES
457
457
4. Deprecated Functionality
458
458
========================================
459
459
460
+ - Zip:
461
+ . Using empty file as ZipArchive is deprecated. Libzip 1.6.0
462
+ do not accept empty files as valid zip archives any longer.
463
+ Existing workaround will be removed in next version.
464
+
460
465
========================================
461
466
5. Changed Functions
462
467
========================================
Original file line number Diff line number Diff line change @@ -1487,7 +1487,6 @@ static ZIPARCHIVE_METHOD(open)
1487
1487
ze_obj -> filename = NULL ;
1488
1488
}
1489
1489
1490
- #if LIBZIP_VERSION_MAJOR > 1 || LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR >= 6
1491
1490
/* reduce BC break introduce in libzip 1.6.0
1492
1491
"Do not accept empty files as valid zip archives any longer" */
1493
1492
@@ -1497,10 +1496,10 @@ static ZIPARCHIVE_METHOD(open)
1497
1496
1498
1497
/* exists and is empty */
1499
1498
if (VCWD_STAT (resolved_path , & st ) == 0 && st .st_size == 0 ) {
1499
+ php_error_docref (NULL , E_DEPRECATED , "Using empty file as ZipArchive is deprecated" );
1500
1500
flags |= ZIP_TRUNCATE ;
1501
1501
}
1502
1502
}
1503
- #endif
1504
1503
1505
1504
intern = zip_open (resolved_path , flags , & err );
1506
1505
if (!intern || err ) {
Original file line number Diff line number Diff line change @@ -20,5 +20,6 @@ $nx->statName("a",ZIPARCHIVE::FL_UNCHANGED);
20
20
$ fname = __DIR__ ."/test53885.zip " ;
21
21
unlink ($ fname );
22
22
?>
23
- --EXPECT--
23
+ --EXPECTF--
24
+ Deprecated: ZipArchive::open(): Using empty file as ZipArchive is deprecated in %s
24
25
==DONE==
You can’t perform that action at this time.
0 commit comments