]> granicus.if.org Git - php/commitdiff
move comment
authorRemi Collet <remi@php.net>
Sun, 7 Jun 2020 06:16:50 +0000 (08:16 +0200)
committerRemi Collet <remi@php.net>
Sun, 7 Jun 2020 06:16:50 +0000 (08:16 +0200)
ext/zip/php_zip.c

index b275985fa885528f0da9981e3eef605418f5a5b9..9ac13d538a32ba62b9bac89eaeb422b6e80f0041 100644 (file)
@@ -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;
                }
        }