Adding fix for Ticket #2821, fixes Controller::postConditions() overrides $data passed in.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5343 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-06-23 08:24:26 +00:00
parent 905549cc89
commit 51aa81f336

View file

@ -875,13 +875,15 @@ class Controller extends Object {
* @return array An array of model conditions * @return array An array of model conditions
*/ */
function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive = false) { function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive = false) {
if ((!is_array($data) || empty($data)) && empty($this->data)) { if (!is_array($data) || empty($data)) {
return null; if (!empty($this->data)) {
} elseif (!empty($this->data)) { $data = $this->data;
$data = $this->data; } else {
return null;
}
} }
$cond = array(); $cond = array();
if ($op === null) { if ($op === null) {
$op = ''; $op = '';
} }