PEAR is archived and read-only

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

Home » Authentication » LiveUser » Bug #2525

LiveUser_Admin_Auth_Container_DB::getUsers() doesn't work with simple filters

Details

Submitted2004-10-14 09:27 UTC
Fromscragz at hotmail dot com
StatusBogus
PackageLiveUser
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2004-10-14 09:27 UTC] scragz at hotmail dot com

Description:
------------
The "documentation" says that filters can either be complex or simple, but the method doesn't work with simple ones (DB error). I submitted a patch for this, but it was lumped in with a bunch of other ones and must have got missed. I'm reporting everything separately from now on.

Reproduce code:
---------------
-foreach ($filters as $f => $v) {
- $cond = ' ' . $v['cond'];
- $where .= ' ' . $v['name'] . $v['op'] . $this->dbc->quoteSmart($v['value']) . $cond;
-}

+foreach ($filters as $f => $v) {
+ if (is_array($v)) {
+ $cond = ' ' . $v['cond'];
+ $where .= ' ' . $v['name'] . $v['op'] . $this->dbc->quoteSmart($v['value']) . $cond;
+ } else {
+ $cond = ' AND';
+ $where .= ' ' . $f . ' = ' . $this->dbc->quoteSmart($v) . $cond;
+ }
+}