php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59534 RarEntry::extract() not accepting password
Submitted: 2010-12-08 11:01 UTC Modified: 2010-12-08 14:38 UTC
From: rogier at dsone dot nl Assigned:
Status: Closed Package: rar (PECL)
PHP Version: 5.3.1 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rogier at dsone dot nl
New email:
PHP Version: OS:

 

 [2010-12-08 11:01 UTC] rogier at dsone dot nl
Description:
------------
The extract() method of the RarEntry class does not to accept the password (3rd) argument, though the method seems to have it whenever I reflect the class.

I do know I can also provide the password using the RarArchive::open() method, but that is not relevant to this bug imho.

Take note: the protected test archive just contains a file 'txt.txt' having random textual content

Reproduce code:
---------------
$rc = new ReflectionClass('RarEntry');
$i=0;
foreach ($rc->getMethod('extract')->getParameters() as $p) echo "prm#".($i++)." {$p->name}\n";

$arc = RarArchive::open('protarch.rar');
$ok=$arc->getEntry('txt.txt')->extract(false,'C:\\tmp\\pwd_txt.txt', 'pass');
if ($ok) echo 'EXTRACTED';

Expected result:
----------------
prm#0 path
prm#1 filename
prm#2 password
EXTRACTED

Actual result:
--------------
prm#0 path
prm#1 filename
prm#2 password
PHP Warning:  RarEntry::extract() expects at most 2 parameters, 3 given in xxxx.php on line xxxx

Warning: RarEntry::extract() expects at most 2 parameters, 3 given in in xxxx.php on line xxxx

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-08 14:38 UTC] cataphract@php.net
This was already fixed in revision #299004 http://svn.php.net/viewvc?view=revision&revision=299004

You can use trunk until the next release.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 29 14:01:24 2020 UTC