From 7c2d6ae1977c9c135de95177c488b1a8875fc9d6 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 28 Jun 2016 22:06:53 -0400 Subject: [PATCH] Combine code paths. At the end of both if/else arms we should have an array that can be pushed through Hash::filter(). Refs #8654 --- lib/Cake/View/Helper/FormHelper.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index e4cbfda9c31..ea190ca6bf9 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -663,11 +663,10 @@ protected function _secure($lock, $field = null, $value = null) { if (!$field) { $field = $this->entity(); } elseif (is_string($field)) { - $field = Hash::filter(explode('.', $field)); + $field = explode('.', $field); } - if (is_array($field)) { - $field = array_filter($field, 'strlen'); + $field = Hash::filter($field); } foreach ($this->_unlockedFields as $unlockField) {