SF.net SVN: postfixadmin:[1493] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2013-06-23 20:02:08
|
Revision: 1493 http://sourceforge.net/p/postfixadmin/code/1493 Author: christian_boltz Date: 2013-06-23 20:02:05 +0000 (Sun, 23 Jun 2013) Log Message: ----------- functions.inc.php: - db_where_clause(): wrap condition in "(...)" model/PFAHandler.php: - read_from_db(): wrap condition in "(...)" Modified Paths: -------------- trunk/functions.inc.php trunk/model/PFAHandler.php Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2013-06-23 17:56:16 UTC (rev 1492) +++ trunk/functions.inc.php 2013-06-23 20:02:05 UTC (rev 1493) @@ -1651,7 +1651,7 @@ if (isset($struct[$field]) && $struct[$field]['type'] == 'bool') $value = db_get_boolean($value); $parts[] = "$field='" . escape_string($value) . "'"; } - $query = " WHERE " . join(" AND ", $parts) . " "; + $query = " WHERE ( " . join(" AND ", $parts) . " ) "; return $query; } Modified: trunk/model/PFAHandler.php =================================================================== --- trunk/model/PFAHandler.php 2013-06-23 17:56:16 UTC (rev 1492) +++ trunk/model/PFAHandler.php 2013-06-23 20:02:05 UTC (rev 1493) @@ -453,12 +453,10 @@ $where = db_where_clause($condition, $this->struct); } else { if ($condition == "") $condition = '1=1'; - $where = " WHERE $condition "; + $where = " WHERE ( $condition ) "; } if ($this->domain_field != "") { - # TODO: wrap where clause in (...) to avoid problems if OR is used? - # TODO: Note: this would need a change in db_where_clause not to include the WHERE keyword in the result $where .= " AND " . db_in_clause($this->domain_field, $this->allowed_domains); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |