summaryrefslogtreecommitdiff
path: root/ext/zip/tests
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2016-09-06 01:18:22 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2016-09-06 01:18:22 +0200
commit1928cdcacb3284658682d0cd68ac1ee3cf9cc653 (patch)
tree7e3855767cf6e862a95c51ec9945e57e5b05c673 /ext/zip/tests
parentcfc83af9780027e97d1d4a17ab5dedb48f6056b1 (diff)
parent81ec843d0ee6a7e236cfab15f1908953d7247677 (diff)
downloadphp-git-1928cdcacb3284658682d0cd68ac1ee3cf9cc653.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
Diffstat (limited to 'ext/zip/tests')
-rw-r--r--ext/zip/tests/bug70752.phpt31
-rw-r--r--ext/zip/tests/bug70752.zipbin0 -> 175 bytes
2 files changed, 31 insertions, 0 deletions
diff --git a/ext/zip/tests/bug70752.phpt b/ext/zip/tests/bug70752.phpt
new file mode 100644
index 0000000000..f006fbee9a
--- /dev/null
+++ b/ext/zip/tests/bug70752.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Bug #70752 (Depacking with wrong password leaves 0 length files)
+--SKIPIF--
+<?php
+if (!extension_loaded('zip')) die('skip zip extension not available');
+?>
+--FILE--
+<?php
+$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.zip';
+$zip = new ZipArchive();
+$zip->open($filename);
+
+$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.txt';
+var_dump(file_exists($filename));
+
+$zip->setPassword('bar'); // correct password would be 'foo'
+$zip->extractTo(__DIR__);
+$zip->close();
+
+var_dump(file_exists($filename));
+?>
+===DONE===
+--EXPECT--
+bool(false)
+bool(false)
+===DONE===
+--CLEAN--
+<?php
+$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.txt';
+unlink($filename);
+?>
diff --git a/ext/zip/tests/bug70752.zip b/ext/zip/tests/bug70752.zip
new file mode 100644
index 0000000000..9bec61bc18
--- /dev/null
+++ b/ext/zip/tests/bug70752.zip
Binary files differ