[-] CORE : Fix bug #PSCFV-10901 warnings on htmlentities
This commit is contained in:
@@ -672,14 +672,20 @@ class ToolsCore
|
||||
public static function htmlentitiesUTF8($string, $type = ENT_QUOTES)
|
||||
{
|
||||
if (is_array($string))
|
||||
return array_map(array('Tools', 'htmlentitiesUTF8'), $string);
|
||||
{
|
||||
$string = array_map(array('Tools', 'htmlentitiesUTF8'), $string);
|
||||
return (string)array_shift($string);
|
||||
}
|
||||
return htmlentities((string)$string, $type, 'utf-8');
|
||||
}
|
||||
|
||||
public static function htmlentitiesDecodeUTF8($string)
|
||||
{
|
||||
if (is_array($string))
|
||||
return array_map(array('Tools', 'htmlentitiesDecodeUTF8'), $string);
|
||||
{
|
||||
$string = array_map(array('Tools', 'htmlentitiesDecodeUTF8'), $string);
|
||||
return (string)array_shift($string);
|
||||
}
|
||||
return html_entity_decode((string)$string, ENT_QUOTES, 'utf-8');
|
||||
}
|
||||
|
||||
|
||||
@@ -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)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<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}" />
|
||||
</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)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<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 type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
@@ -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)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<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 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)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<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 type="submit" id="search_button" class="button_mini" value="{l s='go' mod='blocksearch'}" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user