Skip to content

Commit

Permalink
Check mbstring extension before calling mb_internal_encoding()
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascube committed Nov 19, 2012
1 parent 84294d9 commit 19de536
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions program/include/rcube_mime.php
Expand Up @@ -572,7 +572,7 @@ public static function format_flowed($text, $length = 72, $charset=null)
*/
public static function wordwrap($string, $width=75, $break="\n", $cut=false, $charset=null)
{
if ($charset)
if ($charset && function_exists('mb_internal_encoding'))
mb_internal_encoding($charset);

$para = preg_split('/\r?\n/', $string);
Expand Down Expand Up @@ -629,7 +629,7 @@ public static function wordwrap($string, $width=75, $break="\n", $cut=false, $ch
}
}

if ($charset)
if ($charset && function_exists('mb_internal_encoding'))
mb_internal_encoding(RCMAIL_CHARSET);

return $string;
Expand Down

0 comments on commit 19de536

Please sign in to comment.