From 51aa81f336cf8fe961993491be9b9ffda26cdbc9 Mon Sep 17 00:00:00 2001 From: phpnut Date: Sat, 23 Jun 2007 08:24:26 +0000 Subject: [PATCH] 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 --- cake/libs/controller/controller.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 4ee2241b8..55f9917a5 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -875,13 +875,15 @@ class Controller extends Object { * @return array An array of model conditions */ function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive = false) { - if ((!is_array($data) || empty($data)) && empty($this->data)) { - return null; - } elseif (!empty($this->data)) { - $data = $this->data; + if (!is_array($data) || empty($data)) { + if (!empty($this->data)) { + $data = $this->data; + } else { + return null; + } } - $cond = array(); + if ($op === null) { $op = ''; }