Bug #69520 [Opn->Nab]: zipArchive::setPassword
| From: | cmb@php.net | Date: | Fri, 24 Apr 2015 14:32:25 +0000 |
| Subject: | Bug #69520 [Opn->Nab]: zipArchive::setPassword | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-192326@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69520&edit=1
ID: 69520
Updated by: cmb@php.net
Reported by: iamchoigo at mkinternet dot com
Summary: zipArchive::setPassword
-Status: Open
+Status: Not a bug
Type: Bug
-Package: zip
+Package: Zip Related
Operating System: window
PHP Version: 5.6.8
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
According to the documentation[1] this is not a bug:
| This function only sets the password to be used to decompress the
| archive; it does not turn a non-password-protected ZipArchive
| into a password-protected ZipArchive.
Extending the current behavior has already been filed as request
#67590.
[1] <http://php.net/manual/en/ziparchive.setpassword.php>
Previous Comments:
------------------------------------------------------------------------
[2015-04-24 07:48:26] iamchoigo at mkinternet dot com
Description:
------------
i want to make zip with password.
But i think zipArchive::setPassword don't work.
When using setPassword that making protected zip. right?
so, i want to reply mail about that. thank.
Test script:
---------------
$zip = new ZipArchive ();
$file = "1.txt";
$zipPath = 'test.zip';
if (($zip->open ( $zipPath, ZipArchive::CREATE)) == true) {
$z = $zip->addFile ( $file );
if($z !== false){
//var_dump($z);
}
$a = $zip->setPassword('abc');
$zip->close ();
echo "okey";
Expected result:
----------------
Created ZIP archive should have a password protection, and when opening it on a local machine with
WinZIP, the program should ask for the password prior to open the archive.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69520&edit=1