summaryrefslogtreecommitdiff
path: root/program/lib/html2text.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-02-08 09:06:59 +0000
committeralecpl <alec@alec.pl>2012-02-08 09:06:59 +0000
commit67e5925897144effb8f4a9404bd2c5b25aa1aa4f (patch)
treed10effd99cd75494c0792d5a2fc5e140abe0676f /program/lib/html2text.php
parentf3136149fe680d0d70ca30c78dda3dae41ff7198 (diff)
- Handle HTML entities properly when converting strong/b/th content to upper case
Diffstat (limited to 'program/lib/html2text.php')
-rw-r--r--program/lib/html2text.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/program/lib/html2text.php b/program/lib/html2text.php
index 9fc96eac7..0171f4bbb 100644
--- a/program/lib/html2text.php
+++ b/program/lib/html2text.php
@@ -699,16 +699,22 @@ class html2text
}
/**
- * Strtoupper multibyte wrapper function
+ * Strtoupper multibyte wrapper function with HTML entities handling
*
- * @param string
- * @return string
+ * @param string $str Text to convert
+ * @return string Converted text
*/
private function _strtoupper($str)
{
+ $str = html_entity_decode($str, ENT_COMPAT, RCMAIL_CHARSET);
+
if (function_exists('mb_strtoupper'))
- return mb_strtoupper($str);
+ $str = mb_strtoupper($str);
else
- return strtoupper($str);
+ $str = strtoupper($str);
+
+ $str = htmlspecialchars($str, ENT_COMPAT, RCMAIL_CHARSET);
+
+ return $str;
}
}