alecpl
2012-02-08 67e5925897144effb8f4a9404bd2c5b25aa1aa4f
- Handle HTML entities properly when converting strong/b/th content to upper case


1 files modified
16 ■■■■■ changed files
program/lib/html2text.php 16 ●●●●● patch | view | raw | blame | history
program/lib/html2text.php
@@ -699,16 +699,22 @@
    }
    /**
     *  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;
    }
}