aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2008-11-24 08:14:36 +0000
committerDavid M <davidmj@users.sourceforge.net>2008-11-24 08:14:36 +0000
commit0955e2e539afd9581e8795883efcee76d6021595 (patch)
tree6cf6c78f539560db77f7e59277d413f5007b7c5d
parentae9c4068e7bdb61c7ec67dfc3fb98803d15759d1 (diff)
downloadforums-0955e2e539afd9581e8795883efcee76d6021595.tar
forums-0955e2e539afd9581e8795883efcee76d6021595.tar.gz
forums-0955e2e539afd9581e8795883efcee76d6021595.tar.bz2
forums-0955e2e539afd9581e8795883efcee76d6021595.tar.xz
forums-0955e2e539afd9581e8795883efcee76d6021595.zip
Optimized this so it would not renumber the keys in the array every time it would grab a unicode character. Instead, it uses the php internal functions to get at the array as we see fit.
git-svn-id: file:///svn/phpbb/trunk@9108 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/functions_messenger.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 9dbb85235e..95d293c04d 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -1434,9 +1434,10 @@ function mail_encode($str)
{
$text = '';
- while (sizeof($array) && intval((strlen($text . $array[0]) + 2) / 3) << 2 <= $split_length)
+ while (sizeof($array) && intval((strlen($text . current($array)) + 2) / 3) << 2 <= $split_length)
{
- $text .= array_shift($array);
+ $text .= current($array);
+ unset($array[key($array)]);
}
$str .= $start . base64_encode($text) . $end . ' ';