PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Networking » Net_IMAP » Bug #2379

Unnecessary text in the cmdDeleteACL() function gives rise to PHP errors

Details

Submitted2004-09-23 11:07 UTC
Fromomicron at mighty dot co dot za
Assigneddamian
StatusClosed
PackageNet_IMAP
PHP VersionIrrelevant
OSAll
Roadmaps(Not assigned)

Comments

[2004-09-23 11:07 UTC] omicron at mighty dot co dot za

Description:
------------
IMAPProtocol::cmdDeleteACL() references a variable named $acl which is not present within the function, causing PHP to issue errors.

This problem looks to be a copy-paste bug, as the problematic block of code within the cmdDeleteACL() function (in IMAPProtocol.php) is also present in the cmdSetACL() function which is directly above; cmdSetACL(), however, actually uses this $acl variable.

The attached patch removes this unnecessary block, as well as fixes a small typo in the main IMAP.php file.

Reproduce code:
---------------
diff -U3 IMAP.php.old IMAP.php
--- IMAP.php.old 2004-08-05 04:37:18.000000000 +0200
+++ IMAP.php 2004-09-23 12:29:52.423456777 +0200
@@ -1484,7 +1484,7 @@

/******************************************************************
** **
- ** ALC METHODS **
+ ** ACL METHODS **
** **
******************************************************************/

diff -U3 IMAPProtocol.php.old IMAPProtocol.php
--- IMAPProtocol.php.old 2004-08-05 05:03:45.000000000 +0200
+++ IMAPProtocol.php 2004-09-23 12:30:52.686565719 +0200
@@ -1535,9 +1535,6 @@
return new PEAR_Error("This IMAP server does not support ACL's! ");
}
$mailbox_name=sprintf("\"%s\"",$this->utf_7_encode($mailbox_name) );
- if(is_array($acl)){
- $acl=implode('',$acl);
- }

return $this->_genericCommand('DELETEACL', sprintf("%s \"%s\"",$mailbox_name,$user) );

}

Expected result:
----------------
No errors are issued when calling the IMAP::deleteACL() method.

Actual result:
--------------
When calling IMAP::deleteACL(), PHP issues errors in the relevant logs about the unknown variable "$acl".

[2004-09-23 11:15 UTC] omicron at mighty dot co dot za

A note about the attached patch: It was generated against the latest available release (from http://pear.php.net/get/Net_IMAP) rather than the latest CVS code (from pear/Net_IMAP), as the CVS version seems to be quite different to the released version (out of date?).