From: Remi Collet Date: Sun, 7 Jun 2020 06:16:50 +0000 (+0200) Subject: move comment X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06ff0e8721284f5825c6f6c4e2741d115f834806;p=php move comment --- diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index b275985fa8..9ac13d538a 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1452,9 +1452,6 @@ PHP_METHOD(ZipArchive, open) ze_obj->filename = NULL; } - /* reduce BC break introduce in libzip 1.6.0 - "Do not accept empty files as valid zip archives any longer" */ - /* open for write without option to empty the archive */ #ifdef ZIP_RDONLY if ((flags & (ZIP_TRUNCATE | ZIP_RDONLY)) == 0) { @@ -1466,6 +1463,9 @@ PHP_METHOD(ZipArchive, 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"); + + /* reduce BC break introduce in libzip 1.6.0 + "Do not accept empty files as valid zip archives any longer" */ flags |= ZIP_TRUNCATE; } }