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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 - 31 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC