Skip to content

Commit

Permalink
Applying optimization to Controller::postConditions from 'robustsolut…
Browse files Browse the repository at this point in the history
…ion' Fixes #287
  • Loading branch information
markstory committed Nov 23, 2009
1 parent 2e0acbf commit 5aba143
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cake/libs/controller/controller.php
Expand Up @@ -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)) {
Expand Down

0 comments on commit 5aba143

Please sign in to comment.