From baff06622dddff139770887e4e5cdcaa2a34fee1 Mon Sep 17 00:00:00 2001 From: RyujiAMANO Date: Fri, 20 May 2016 18:58:50 +0900 Subject: [PATCH 1/2] =?UTF-8?q?NetCommonsHtml::blockTitle=E3=81=AEescape?= =?UTF-8?q?=E5=87=A6=E7=90=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Helper/NetCommonsHtmlHelper.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/View/Helper/NetCommonsHtmlHelper.php b/View/Helper/NetCommonsHtmlHelper.php index 041bd401..e7ea9a95 100644 --- a/View/Helper/NetCommonsHtmlHelper.php +++ b/View/Helper/NetCommonsHtmlHelper.php @@ -206,16 +206,14 @@ public function link($title = '', $url = null, $options = array()) { public function blockTitle($text = '', $titleIcon = null, $options = array()) { $output = ''; - if ($titleIcon) { - $text = $this->titleIcon($titleIcon) . ' ' . h($text); + $escape = Hash::get($options, 'escape', true); + if($escape){ + $text = h($text); + } + $options = Hash::insert($options, 'escape', false); - $options = Hash::merge( - array('escape' => false), $options - ); - } else { - $options = Hash::merge( - array('escape' => true), $options - ); + if ($titleIcon) { + $text = $this->titleIcon($titleIcon) . ' ' . $text; } $output .= $this->Html->tag('h1', $text, $options); From 218c46fefc5d3ebf31c92e4f4b94816fba977ce5 Mon Sep 17 00:00:00 2001 From: RyujiAMANO Date: Fri, 20 May 2016 19:00:02 +0900 Subject: [PATCH 2/2] ReformatCode --- View/Helper/NetCommonsHtmlHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/View/Helper/NetCommonsHtmlHelper.php b/View/Helper/NetCommonsHtmlHelper.php index e7ea9a95..d4dc10cd 100644 --- a/View/Helper/NetCommonsHtmlHelper.php +++ b/View/Helper/NetCommonsHtmlHelper.php @@ -207,7 +207,7 @@ public function blockTitle($text = '', $titleIcon = null, $options = array()) { $output = ''; $escape = Hash::get($options, 'escape', true); - if($escape){ + if ($escape) { $text = h($text); } $options = Hash::insert($options, 'escape', false);