Permalink
Browse files

Little optimization in postConditions of controller.

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
1 parent 1c0c1bc commit 1cef0ac98120c74dc8738cef849184b095fe2e18 @jrbasso jrbasso committed with markstory Nov 19, 2009
Showing with 8 additions and 6 deletions.
  1. +8 −6 cake/libs/controller/controller.php
@@ -899,12 +899,14 @@ function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive =
foreach ($fields as $field => $value) {
$key = $model.'.'.$field;
$fieldOp = $op;
- if (is_array($op) && array_key_exists($key, $op)) {
- $fieldOp = $op[$key];
- } elseif (is_array($op) && array_key_exists($field, $op)) {
- $fieldOp = $op[$field];
- } elseif (is_array($op)) {
- $fieldOp = false;
+ if (is_array($op)) {
+ if (array_key_exists($key, $op)) {
+ $fieldOp = $op[$key];
+ } elseif (array_key_exists($field, $op)) {
+ $fieldOp = $op[$field];
+ } else {
+ $fieldOp = false;
+ }
}
if ($exclusive && $fieldOp === false) {
continue;

0 comments on commit 1cef0ac

Please sign in to comment.