Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-19266 lib/html2text: fix warnings in cron when using PHP4

  • Loading branch information...
commit 15df124a39c4c856835de5731e1bcbb7e6732889 1 parent d78b0e3
fmarier authored
Showing with 21 additions and 2 deletions.
  1. +1 −1  lib/html2text.php
  2. +20 −1 lib/html2text_readme.txt
View
2  lib/html2text.php
@@ -471,7 +471,7 @@ function _convert()
$text = preg_replace_callback($this->callback_search, array('html2text', '_preg_callback'), $text);
// Replace known html entities
- $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
+ $text = utf8_encode(html_entity_decode($text));
// Remove unknown/unhandled entities (this cannot be done in search-and-replace block)
$text = preg_replace('/&[^&;]+;/i', '', $text);
View
21 lib/html2text_readme.txt
@@ -1,5 +1,24 @@
-html2text.php is an unmodified copy of a file shipped with the RoundCube project:
+html2text.php is a modified copy of a file shipped with the RoundCube project:
http://trac.roundcube.net/log/trunk/roundcubemail/program/lib/html2text.php
+
+Modifications
+--------------
+
+1- fix for these warnings in cron:
+
+ "html_entity_decode bug - cannot yet handle MBCS in html_entity_decode()!"
+
+by using this code:
+
+ utf8_encode(html_entity_decode($string));
+
+instead of:
+
+ html_entity_decode($string, ENT_COMPAT, 'UTF-8');
+
+(see http://nz.php.net/manual/en/function.html-entity-decode.php#89483)
+
+
-- Francois Marier <francois@catalyst.net.nz> 2009-05-22
Please sign in to comment.
Something went wrong with that request. Please try again.