// small fix

This commit is contained in:
Rémi Gaillard
2013-11-04 10:34:58 +01:00
parent d49c4cf62e
commit 6ef7f258ea
5 changed files with 17 additions and 10 deletions
+2 -4
View File
@@ -672,10 +672,8 @@ class ToolsCore
public static function htmlentitiesUTF8($string, $type = ENT_QUOTES)
{
if (is_array($string))
{
$string = array_map(array('Tools', 'htmlentitiesUTF8'), $string);
return (string)array_shift($string);
}
return array_map(array('Tools', 'htmlentitiesUTF8'), $string);
return htmlentities((string)$string, $type, 'utf-8');
}
+2 -2
View File
@@ -29,7 +29,7 @@
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="search" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input class="search_query" type="search" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{Tools::htmlentitiesUTF8($search_query)|stripslashes}" />
</form>
</div>
{else}
@@ -41,7 +41,7 @@
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{Tools::htmlentitiesUTF8($search_query)|stripslashes}" />
<input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />
</p>
</form>
+11 -2
View File
@@ -84,7 +84,11 @@ public function hookDisplayMobileHeader($params)
if (Tools::getValue('search_query') || !$this->isCached('blocksearch.tpl', $this->getCacheId()))
{
$this->calculHookCommon($params);
$this->smarty->assign('blocksearch_type', 'block');
$this->smarty->assign(array(
'blocksearch_type' => 'block',
'search_query' => (string)Tools::getValue('search_query')
)
);
}
return $this->display(__FILE__, 'blocksearch.tpl', Tools::getValue('search_query') ? null : $this->getCacheId());
}
@@ -94,7 +98,12 @@ public function hookDisplayMobileHeader($params)
if (Tools::getValue('search_query') || !$this->isCached('blocksearch-top.tpl', $this->getCacheId('blocksearch-top')))
{
$this->calculHookCommon($params);
$this->smarty->assign('blocksearch_type', 'top');
$this->smarty->assign(array(
'blocksearch_type' => 'top',
'search_query' => (string)Tools::getValue('search_query')
)
);
}
return $this->display(__FILE__, 'blocksearch-top.tpl', Tools::getValue('search_query') ? null : $this->getCacheId('blocksearch-top'));
+1 -1
View File
@@ -32,7 +32,7 @@
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{$search_query|escape:'htmlall':'UTF-8'|stripslashes}" />
<input type="submit" id="search_button" class="button_mini" value="{l s='Go!' mod='blocksearch'}" />
</p>
</form>
@@ -32,7 +32,7 @@
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{$search_query|escape:'htmlall':'UTF-8'|stripslashes}" />
<input type="submit" id="search_button" class="button_mini" value="{l s='go' mod='blocksearch'}" />
</p>
</form>