diff options
author | Thomas B. <thomas@roundcube.net> | 2013-07-25 12:40:11 -0700 |
---|---|---|
committer | Thomas B. <thomas@roundcube.net> | 2013-07-25 12:40:11 -0700 |
commit | c6af21333d1d0daee614260022ed09d1dad3a7b1 (patch) | |
tree | eea79d519043f6d1ab1520a9e2e530a12b9bddc3 /program | |
parent | b2ddc5a314b7791dfd356201da60ed2ad8e27b1a (diff) | |
parent | b6a640bdc973efd8a50a0f91e02a3392759dbfda (diff) |
Merge pull request #98 from rodrigo-castillo/master
replaces smart quotes with regular quotes
Diffstat (limited to 'program')
-rw-r--r-- | program/lib/Roundcube/rcube_washtml.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_washtml.php b/program/lib/Roundcube/rcube_washtml.php index 6b2efcc78..8f7fe9749 100644 --- a/program/lib/Roundcube/rcube_washtml.php +++ b/program/lib/Roundcube/rcube_washtml.php @@ -410,6 +410,25 @@ class rcube_washtml ); $html = preg_replace($html_search, $html_replace, trim($html)); + //-> Replace all of those weird MS Word quotes and other high characters + $badwordchars=array( + "\xe2\x80\x98", // left single quote + "\xe2\x80\x99", // right single quote + "\xe2\x80\x9c", // left double quote + "\xe2\x80\x9d", // right double quote + "\xe2\x80\x94", // em dash + "\xe2\x80\xa6" // elipses + ); + $fixedwordchars=array( + "'", + "'", + '"', + '"', + '—', + '...' + ); + $html = str_replace($badwordchars,$fixedwordchars, $html); + // PCRE errors handling (#1486856), should we use something like for every preg_* use? if ($html === null && ($preg_error = preg_last_error()) != PREG_NO_ERROR) { $errstr = "Could not clean up HTML message! PCRE Error: $preg_error."; |