|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-07-08 16:44 UTC] aharvey@php.net
-Type: Bug
+Type: Feature/Change Request
-Package: Zlib related
+Package: Zip Related
[2014-09-18 00:52 UTC] miguelwmonteiro at gmail dot com
[2015-07-17 10:44 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2015-07-17 10:44 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 07:00:01 2025 UTC |
Description: ------------ Ziparchive now is able to read the files inside a password protected zip file, but is yet unable to append new files to this package using the supplied password. Test script: --------------- <?php $file = '/tmp/data'; $data = array(1,2,3); file_put_contents($file,json_encode($data)); $r = system('zip -P password file.zip /tmp/data'); //$r = system('zip file.zip /tmp/data'); $zip = new ZipArchive; $zip->open('file.zip'); $r = $zip->setPassword('password'); $data = $zip->getFromName('tmp/data'); var_dump($data); /* Insert new file */ $r = $zip->addFromString('tmp/test',json_encode($data)); $data = $zip->getFromName('tmp/data'); var_dump($data); unlink($file); $zip->close(); Expected result: ---------------- The new file added is encrypted by the password you set. Actual result: -------------- The file is currently not protected by any password