Browse files

Applying optimization to Controller::postConditions from 'robustsolut…

…ion' Fixes #287
  • Loading branch information...
1 parent 2e0acbf commit 5aba1436202baf820316432823609e823da6cbbf @markstory markstory committed Nov 23, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 cake/libs/controller/controller.php
View
3 cake/libs/controller/controller.php
@@ -895,11 +895,12 @@ function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive =
$op = '';
}
+ $arrayOp = is_array($op);
foreach ($data as $model => $fields) {
foreach ($fields as $field => $value) {
$key = $model.'.'.$field;
$fieldOp = $op;
- if (is_array($op)) {
+ if ($arrayOp) {
if (array_key_exists($key, $op)) {
$fieldOp = $op[$key];
} elseif (array_key_exists($field, $op)) {

0 comments on commit 5aba143

Please sign in to comment.