Permalink
Browse files

BUGFIX Fix to prevent unintended results from getComponentsQuery(...)

Wrapped $filter inside parentheses to prevent unintended results if $filter contains "OR".
  • Loading branch information...
1 parent 7a8c35f commit 499b7c9ff9d2872a0708a526ea683670bbad2a96 @stozze stozze committed with stozze Sep 14, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 model/DataObject.php
View
@@ -1359,7 +1359,7 @@ public function getComponentsQuery($componentName, $filter = "", $sort = "", $jo
// get filter
$combinedFilter = "\"$joinField\" = '$id'";
- if($filter) $combinedFilter .= " AND {$filter}";
+ if(!empty($filter)) $combinedFilter .= " AND ({$filter})";
return singleton($componentClass)->extendedSQL($combinedFilter, $sort, $limit, $join);
}

0 comments on commit 499b7c9

Please sign in to comment.