|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2021-03-05 04:34 UTC] admin at lithi dot io
[2021-03-05 10:49 UTC] cmb@php.net
-Status: Open
+Status: Verified
-PHP Version: 8.0.3
+PHP Version: 7.4
-Assigned To:
+Assigned To: cmb
[2021-03-05 10:49 UTC] cmb@php.net
[2021-03-05 13:13 UTC] cmb@php.net
[2021-03-05 13:29 UTC] cmb@php.net
[2021-03-30 13:00 UTC] cmb@php.net
-Assigned To: cmb
+Assigned To:
[2021-08-12 06:05 UTC] remi@php.net
[2021-09-01 13:52 UTC] git@php.net
[2021-09-01 13:52 UTC] git@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 15:00:01 2025 UTC |
Description: ------------ I try to read the content of a ZIP archive entry with ZipArchive::getStream to put its content into a variable with fread(). The archive is protected by a password (EM_AES_256). getStream() doesn't use setPassword() to provide a stream. getStream() from a non-password protected archive works. extractTo() from a password protected archive works. Thanks. Test script: --------------- <?php $create_zip = new ZipArchive(); $create_zip->open("test.zip", ZipArchive::CREATE); $create_zip->setPassword("password"); $create_zip->addFromString("test.txt", "This is a test string."); $create_zip->setEncryptionName("test.txt", ZipArchive::EM_AES_256); $create_zip->close(); $extract_zip = new ZipArchive(); $extract_zip->open("test.zip", ZipArchive::RDONLY); $extract_zip->setPassword("password"); $file_stream = $extract_zip->getStream("test.txt"); if (is_resource($file_stream)) { echo "OK".PHP_EOL; } else { echo "NOT OK".PHP_EOL; } unlink("test.zip"); fclose($file_stream); $extract_zip->close(); Expected result: ---------------- OK Actual result: -------------- NOT OK