bug70752.phpt 587 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Bug #70752 (Depacking with wrong password leaves 0 length files)
  3. --EXTENSIONS--
  4. zip
  5. --FILE--
  6. <?php
  7. $filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.zip';
  8. $zip = new ZipArchive();
  9. $zip->open($filename);
  10. $filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.txt';
  11. var_dump(file_exists($filename));
  12. $zip->setPassword('bar'); // correct password would be 'foo'
  13. $zip->extractTo(__DIR__);
  14. $zip->close();
  15. var_dump(file_exists($filename));
  16. ?>
  17. --EXPECT--
  18. bool(false)
  19. bool(false)
  20. --CLEAN--
  21. <?php
  22. $filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.txt';
  23. unlink($filename);
  24. ?>