PEAR is archived and read-only

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

Home » Networking » Net_POP3 » Bug #3410

Error handling in _sendCmd

Details

Submitted2005-02-09 09:30 UTC
Fromforjest at gmail dot com
Assigneddamian
StatusClosed
PackageNet_POP3
PHP VersionIrrelevant
OSOS Independ
Roadmaps(Not assigned)

Comments

[2005-02-09 09:30 UTC] forjest at gmail dot com

Description:
------------
In some cases (undetermined) on string
return $this->_raiseError($data); PHP gives a notice.

Seems errorous error handling and there should be separate handling for cases when
PEAR::isError($result) and when
PEAR::isError($data).
Course when
PEAR::isError($result) is true
$data not exists.

Reproduce code:
---------------
/////////////////////////////////
function _sendCmd($cmd)
{
$result = $this->_send($cmd);

if (!PEAR::isError($result) AND $result) {
$data = $this->_recvLn();
if (!PEAR::isError($data) AND strtoupper(substr($data, 0, 3)) == '+OK') {
return $data;
}
}
return $this->_raiseError($data);
}
///////////////////////////////

Expected result:
----------------
When $result is error no notice is showed.

Actual result:
--------------
Notice: Undefined variable: data in <path here>POP3.php on line 1086
Package version is 1.3.3.
In new version that is line 1105.