From: x2003bruneau Date: Mon, 12 Feb 2007 11:07:24 +0000 (+0000) Subject: Fix issues with some F****** curly-quotes X-Git-Tag: xorg/0.9.13~14 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=780f562b76f6de42e59f200b59aa8280e4a7de49;p=platal.git Fix issues with some F****** curly-quotes git-svn-id: svn+ssh://murphy/home/svn/platal/branches/platal-0.9.13@1495 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/classes/env.php b/classes/env.php index 22a5b7d..3aecdf3 100644 --- a/classes/env.php +++ b/classes/env.php @@ -165,8 +165,11 @@ function fix_gpc_magic(&$item, $key) { 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); + } } } diff --git a/classes/platalpage.php b/classes/platalpage.php index fad9a66..6b10859 100644 --- a/classes/platalpage.php +++ b/classes/platalpage.php @@ -304,6 +304,7 @@ function _hide_email($source) function hide_emails($source, &$smarty) { + $source = str_replace('’', ''', $source); fix_encoding($source); //prevent email replacement in