]> granicus.if.org Git - php/commitdiff
Add test for bug #72258
authorAnatol Belski <ab@php.net>
Mon, 30 May 2016 10:47:04 +0000 (12:47 +0200)
committerAnatol Belski <ab@php.net>
Mon, 30 May 2016 10:47:04 +0000 (12:47 +0200)
ext/zip/tests/bug72258.phpt [new file with mode: 0644]
ext/zip/tests/bug72258.zip [new file with mode: 0644]

diff --git a/ext/zip/tests/bug72258.phpt b/ext/zip/tests/bug72258.phpt
new file mode 100644 (file)
index 0000000..0e0c8c1
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+Bug #72258 ZipArchive converts fns to unrecoverable form
+--SKIPIF--
+<?php
+/* $Id$ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+
+$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug72258.zip";
+
+$zip = new \ZipArchive();
+$res = $zip->open($fn);
+if ($res !== true) {
+               echo 'Error opening: ' . $res;
+                       die();
+}
+
+for ($i = 0; $i < $zip->numFiles; $i++) {
+       $fnInArc = $zip->getNameIndex($i, ZipArchive::FL_ENC_RAW);
+       var_dump($fnInArc);
+}
+?>
+--EXPECT--
+string(6) "\80\81\82\83\84/"
diff --git a/ext/zip/tests/bug72258.zip b/ext/zip/tests/bug72258.zip
new file mode 100644 (file)
index 0000000..07ea2e4
Binary files /dev/null and b/ext/zip/tests/bug72258.zip differ