Fix issues with some F****** curly-quotes
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 12 Feb 2007 11:07:24 +0000 (11:07 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 12 Feb 2007 11:07:24 +0000 (11:07 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/branches/platal-0.9.13@1495 839d8a87-29fc-0310-9880-83ba4fa771e5

classes/env.php
classes/platalpage.php

index 22a5b7d..3aecdf3 100644 (file)
@@ -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('&#8217;', "'", $item);
+        if (preg_match('/[\x80-\x9f]/', $item)) {
+            $item = iconv('CP1252', 'ISO-8859-15//TRANSLIT', $item);
+        }    
     }
 }
 
index fad9a66..6b10859 100644 (file)
@@ -304,6 +304,7 @@ function _hide_email($source)
 
 function hide_emails($source, &$smarty)
 {
+    $source = str_replace('&#8217;', '&apos;', $source);
     fix_encoding($source);
 
     //prevent email replacement in <script> and <textarea>