From 671c31218f6f4a9f33277e0b3467f50f7b9c098f Mon Sep 17 00:00:00 2001 From: Tigran Gabrielyan Date: Mon, 21 May 2012 13:56:51 -0700 Subject: [PATCH] Making FormHelper::inputDefaults() code more readable --- lib/Cake/View/Helper/FormHelper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index ae93b0837..493f98be5 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -2592,7 +2592,11 @@ class FormHelper extends AppHelper { */ public function inputDefaults($defaults = null, $merge = false) { if (!is_null($defaults)) { - $this->_inputDefaults = array_merge($merge ? $this->_inputDefaults : array(), (array)$defaults); + if ($merge) { + $this->_inputDefaults = array_merge($this->_inputDefaults, (array)$defaults); + } else { + $this->_inputDefaults = (array)$defaults; + } } return $this->_inputDefaults; }