Applying optimization to Controller::postConditions from 'robustsolution' Fixes #287

This commit is contained in:
mark_story 2009-11-23 12:52:38 -05:00
parent 2e0acbf505
commit 5aba143620

View file

@ -895,11 +895,12 @@ class Controller extends Object {
$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)) {