PEAR is archived and read-only

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

Home » Database » DB_ldap » Bug #3463

query disregards parameters

Details

Submitted2005-02-14 17:00 UTC
Frommculey at jccc dot net
Assigneddufuz
StatusClosed
PackageDB_ldap
PHP Version5.0.3
OSLinux
Roadmaps(Not assigned)

Comments

[2005-02-14 17:00 UTC] mculey at jccc dot net

Description:
------------
Function query does not pass on the parameters passed to it when calling simpleQuery. This causes all queries to the ldap store to return ALL parameters, ignoring the list of parameters passed in.

Reproduce code:
---------------
Changed line 606 from:

$result = $this->simpleQuery($query);

to:

$result = $this->simpleQuery($query, $action, $params);

Expected result:
----------------
$result should contain only the parameters I've requested in the function call.

[2005-06-03 06:18 UTC] Jan dot Blaha at karosa dot iveco dot com

First two lines of query method solves the issue. In the release, they are commented out. I don't know the reason behind this. But applying following trivial patch solves the issue.

*** ldap.php Fri Jun 03 08:06:23 2005
--- ldap.php.orig Fri Jun 03 08:06:52 2005
***************
*** 594,601 ****
* @see DB_common::prepare() $this->execute()$this->simpleQuery()
*/
function &query($query, $data = array(), $action = null, $params = array()) {
! $this->q_action = $action ? $action : $this->action;
! $this->q_params = $params;
if (sizeof($data) > 0) {
$sth = $this->prepare($query);
if (DB::isError($sth)) {
--- 594,601 ----
* @see DB_common::prepare() $this->execute()$this->simpleQuery()
*/
function &query($query, $data = array(), $action = null, $params = array()) {
! // $this->q_action = $action ? $action : $this->action;
! // $this->q_params = $params;
if (sizeof($data) > 0) {
$sth = $this->prepare($query);
if (DB::isError($sth)) {