]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.3' into PHP-7.4
authorRemi Collet <remi@php.net>
Fri, 28 Feb 2020 09:35:39 +0000 (10:35 +0100)
committerRemi Collet <remi@php.net>
Fri, 28 Feb 2020 09:35:39 +0000 (10:35 +0100)
* PHP-7.3:
  Fix #79315 ZipArchive::addFile doesn't honor start/length parameters

1  2 
ext/zip/php_zip.c
ext/zip/tests/oo_addfile.phpt

Simple merge
index 254f2b762073ac8cdedfd9f636e4340cd4814adf,37320de6277d36ebbf9df5cd431475dcd4a5946e..84dea866142f97849bc1452470f6f57584ef61f6
@@@ -20,18 -20,11 +20,22 @@@ if (!$zip->open($file)) 
  if (!$zip->addFile($dirname . 'utils.inc', 'test.php')) {
        echo "failed\n";
  }
+ if (!$zip->addFile($dirname . 'utils.inc', 'mini.txt', 12, 34)) {
+       echo "failed\n";
+ }
  if ($zip->status == ZIPARCHIVE::ER_OK) {
 -      dump_entries_name($zip);
 +      if (!verify_entries($zip, [
 +              "bar",
 +              "foobar/",
 +              "foobar/baz",
 +              "entry1.txt",
-               "test.php"
++              "test.php",
++              "mini.txt"
 +      ])) {
 +              echo "failed\n";
 +      } else {
 +              echo "OK";
 +      }
        $zip->close();
  } else {
        echo "failed\n";
@@@ -39,4 -37,11 +48,6 @@@ var_dump(strlen($zip->getFromName('mini
  @unlink($file);
  ?>
  --EXPECT--
 -0 bar
 -1 foobar/
 -2 foobar/baz
 -3 entry1.txt
 -4 test.php
 -5 mini.txt
 +OK
+ bool(true)
+ bool(true)