function fix_encoding(&$item, $key = null) {
if (is_array($item)) {
array_walk($item, 'fix_encoding');
- } elseif (preg_match('/[\x80-\x9f]/', $item)) {
- $item = iconv('CP1252', 'ISO-8859-15//TRANSLIT', $item);
+ } else {
+ $item = str_replace('’', "'", $item);
+ if (preg_match('/[\x80-\x9f]/', $item)) {
+ $item = iconv('CP1252', 'ISO-8859-15//TRANSLIT', $item);
+ }
}
}
function hide_emails($source, &$smarty)
{
+ $source = str_replace('’', ''', $source);
fix_encoding($source);
//prevent email replacement in <script> and <textarea>