Home » Authentication » LiveUser » Bug #2525
LiveUser_Admin_Auth_Container_DB::getUsers() doesn't work with simple filters
Details
| Submitted | 2004-10-14 09:27 UTC |
|---|---|
| From | scragz at hotmail dot com |
| Status | Bogus |
| Package | LiveUser |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| 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;
+ }
+}