diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-02-08 09:06:59 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-02-08 09:06:59 +0000 |
| commit | c8b64f3987e881c15161dc37899a1391df3f6a43 (patch) | |
| tree | 1f10299ca239c04653129b0685ce6287fef41f97 /roundcubemail/program/lib/html2text.php | |
| parent | eb8a3d2f0ebd599b3b0103ce4793920035ce1cd9 (diff) | |
- Handle HTML entities properly when converting strong/b/th content to upper case
git-svn-id: https://svn.roundcube.net/trunk@5861 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/lib/html2text.php')
| -rw-r--r-- | roundcubemail/program/lib/html2text.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/roundcubemail/program/lib/html2text.php b/roundcubemail/program/lib/html2text.php index 9fc96eac7..0171f4bbb 100644 --- a/roundcubemail/program/lib/html2text.php +++ b/roundcubemail/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; } } |
