Navigation Menu

Skip to content

Commit

Permalink
Small optimization of the function prepare_mb_list_encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
SL-Gundam committed Jun 14, 2015
1 parent 153fe2f commit 1e0e00f
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions core/Mail/Parser.php
Expand Up @@ -74,12 +74,6 @@ private function prepare_mb_list_encodings()

$t_charset_list = mb_list_encodings();

$r_charset_list = array();
foreach ( $t_charset_list AS $t_value )
{
$r_charset_list[ strtolower( $t_value ) ] = $t_value;
}

// This function does not exist in version older then PHP 5.3.0
if ( function_exists( 'mb_encoding_aliases' ) )
{
Expand All @@ -89,13 +83,13 @@ private function prepare_mb_list_encodings()
$t_encoding_aliases = array_merge( $t_encoding_aliases, mb_encoding_aliases( $t_value ) );
}

foreach ( $t_encoding_aliases AS $t_value )
{
if ( !isset( $r_charset_list[ strtolower( $t_value ) ] ) )
{
$r_charset_list[ strtolower( $t_value ) ] = $t_value;
}
}
$t_charset_list = array_merge( $t_charset_list, $t_encoding_aliases );
}

$r_charset_list = array();
foreach ( $t_charset_list AS $t_value )
{
$r_charset_list[ strtolower( $t_value ) ] = $t_value;
}

$this->_mb_list_encodings = $r_charset_list + $this->_mbstring_unsupportedcharsets;
Expand Down

0 comments on commit 1e0e00f

Please sign in to comment.