PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Networking » Net_LDAP » Bug #7823

reBind with bad password throws fatal error

Details

Submitted2006-06-06 15:28 UTC
Frommortonda at dgrmm dot net
Assignedbeni
StatusClosed
PackageNet_LDAP
PHP Version4.4.2
OSUbuntu dapper
Roadmaps(Not assigned)

Comments

[2006-06-06 15:28 UTC] mortonda at dgrmm dot net

Description:
------------
When I try to rebind (with bad password), it crashes my script with:

Warning: PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions in /usr/share/php/PEAR.php on line 905

Fatal error: Cannot instantiate non-existent class: exception in /usr/share/php/PEAR.php(906) : eval()'d code on line 1

[2006-06-06 15:54 UTC] mortonda at dgrmm dot net

Looks like it is a mismatch between parameters. PEAR calls Net_LDAP_Error like:

$a = &new $ec($message, $code, $mode, $options, $userinfo);

and so the mode and code gets mixed up.

[2006-06-06 16:04 UTC] mortonda at dgrmm dot net

Changing the Net_LDAP_Error constructor to this works for me: (Not sure how it affects any other code)

function Net_LDAP_Error($code = NET_LDAP_ERROR, $mode = PEAR_ERROR_RETURN,
$level = E_USER_NOTICE, $debuginfo = null)
{
if (is_int($code)) {
$this->PEAR_Error('Net_LDAP_Error: ' . Net_LDAP::errorMessage($code), $code, $mode, $level, $debuginfo);
} else { // parameters are shifted...
$this->PEAR_Error("Net_LDAP_Error: $code", NET_LDAP_ERROR, $code, $mode, $level);
}
}

[2006-06-06 16:23 UTC] mortonda at dgrmm dot net

BTW, this really looks like a bad design in the PEAR Error API. 4 or 5 parameters?

[2006-07-14 09:49 UTC] b dot hallinger at skyforcesystems dot de

reBind() is oboslete in CVS-Version and replaced by bind().