Warning: htmlentities() [function.htmlentities]: charset `ISO-8859-2' not supported, assuming iso-8859-1 in /home/pcpedia/ftp/assets/snippets/ajaxSearch/ajaxSearch.php on line 163 Warning: htmlentities() [function.htmlentities]: charset `ISO-8859-2' not supported, assuming iso-8859-1 in /home/pcpedia/ftp/assets/snippets/ajaxSearch/ajaxSearch.php on line 163
I wrote usefull function which is support iso-8859-2 encoding with htmlentities function ;]
<?php
/*
* Function htmlentities which support iso-8859-2
*
* @param string
* @return string
* @author FanFataL
*/
function htmlentities_iso88592($string='') {
$pl_iso = array('ê', 'ó', '±', '¶', '³', '¿', '¼', 'æ', 'ñ', 'Ê', 'Ó', '¡', '¦', '£', '¬', '¯', 'Æ', 'Ñ');
$entitles = get_html_translation_table(HTML_ENTITIES);
$entitles = array_diff($entitles, $pl_iso);
return strtr($string, $entitles);
}
?>
Thanks Jako for this quick solution about this issue. I have already noticed it, but by lack of time, not investigate on it. This issue don’t occur with the non ajax-mode and as it didn’t exist with the previous version, is clearly a code regression >:(
$('current-search-results').setHTML(decodeURIComponent(request));
$text=strip_tags($SearchFormsrc['content']);
When you have a non-Ajax search and it returns a page full of results; it will also sometimes include parts of HTML.Can you give a site address where I can examine this issue or at least (by personal message if needed) a copy of the document content.
For example in some searches I found that it returns part of a HTML <p>, or worse part of a HTML anchor (sometimes broken).
function PrepareSearchContent( $text ) {
// Remove modx sensitive tags
$text = stripSnip($text);
// strips tags won't remove the actual jscript
$text = preg_replace( "'<script[^>]*>.*?</script>'si", "", $text );
$text = preg_replace( '/{.+?}/', '', $text);
// $text = preg_replace( '/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is','\2', $text );
// replace line breaking tags with whitespace
$text = preg_replace( "'<(br[^/>]*?/|hr[^/>]*?/|/(div|h[1-6]|li|p|td))>'si", ' ', $text );
$text = stripHtml($text); // strip html tags. Tags should be correctly ended
return $text;
}This discussion is closed to further replies. Keep calm and carry on.