diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-07 12:36:31 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-07 12:36:31 +0000 |
commit | f8528a659c919d7bc1e78c5aacc95e27cddec627 (patch) | |
tree | bb70865f922867a83fa144f315ad40014a982e2b /phpBB/includes/functions.php | |
parent | e87f740a9e7a048b7900d92ede04f405a337441c (diff) | |
download | forums-f8528a659c919d7bc1e78c5aacc95e27cddec627.tar forums-f8528a659c919d7bc1e78c5aacc95e27cddec627.tar.gz forums-f8528a659c919d7bc1e78c5aacc95e27cddec627.tar.bz2 forums-f8528a659c919d7bc1e78c5aacc95e27cddec627.tar.xz forums-f8528a659c919d7bc1e78c5aacc95e27cddec627.zip |
tried to begin adjusting all string functions where applicable - still a *lot* to do.
i hope i catched all relevant sections and did not mess something up.
git-svn-id: file:///svn/phpbb/trunk@6452 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 5c260e6547..4bb99f737d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -653,7 +653,7 @@ function tz_select($default = '', $truncate = false) { if ($truncate) { - $zone = (strlen($zone) > 70) ? substr($zone, 0, 70) . '...' : $zone; + $zone = (utf8_strlen($zone) > 70) ? utf8_substr($zone, 0, 70) . '...' : $zone; } if (is_numeric($offset)) @@ -1793,7 +1793,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa $admin = ($admin) ? 1 : 0; // Check if the supplied username is equal to the one stored within the database if re-authenticating - if ($admin && strtolower($username) != strtolower($user->data['username'])) + if ($admin && utf8_strtolower($username) != utf8_strtolower($user->data['username'])) { // We log the attempt to use a different username... add_log('admin', 'LOG_ADMIN_AUTH_FAIL'); @@ -2696,22 +2696,8 @@ function truncate_string($string, $max_length = 60, $allow_reply = true) $string = substr($string, 4); } - // split the multibyte characters first - $string_ary = preg_split('/(&#[0-9]+;)/', $string, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - - // Now go through the array and split the other characters - foreach ($string_ary as $key => $value) - { - if (strpos($value, '&#') === 0) - { - $chars[] = $value; - continue; - } - - // decode html entities and put them back later - $_chars = str_split(html_entity_decode($value)); - $chars = array_merge($chars, array_map('htmlspecialchars', $_chars)); - } + $_chars = utf8_str_split(html_entity_decode($string)); + $chars = array_map('htmlspecialchars', $_chars); // Now check the length ;) if (sizeof($chars) > $max_length) |