diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-25 12:00:44 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-25 12:00:44 +0000 |
commit | 7dffca0c05420e9734726a6d053b31305e9cda25 (patch) | |
tree | b7ea959ac9c6c00c5f30f138d35fc4d70164d38f /mod/notifications/views/default | |
parent | c8d31fc57145732d489548b5866cf0cda51a3393 (diff) | |
download | elgg-7dffca0c05420e9734726a6d053b31305e9cda25.tar.gz elgg-7dffca0c05420e9734726a6d053b31305e9cda25.tar.bz2 |
Unicode character fix for friends picker. Fixes #281
git-svn-id: https://code.elgg.org/elgg/trunk@2941 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/notifications/views/default')
-rw-r--r-- | mod/notifications/views/default/notifications/subscriptions/forminternals.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/mod/notifications/views/default/notifications/subscriptions/forminternals.php b/mod/notifications/views/default/notifications/subscriptions/forminternals.php index d8c1a34f8..aa6b2454d 100644 --- a/mod/notifications/views/default/notifications/subscriptions/forminternals.php +++ b/mod/notifications/views/default/notifications/subscriptions/forminternals.php @@ -73,8 +73,11 @@ // Sort users by letter if (is_array($friends) && sizeof($friends)) foreach($friends as $user) { - - $letter = strtoupper(substr($user->name,0,1)); +
+ if (is_callable('mb_substr')) + $letter = strtoupper(mb_substr($user->name,0,1));
+ else
+ $letter = strtoupper(substr($user->name,0,1)); if (!substr_count($chararray,$letter)) { $letter = "*"; } @@ -147,8 +150,11 @@ <div class="friendsPicker_container"> <?php - // Initialise letters - $letter = substr($chararray,0,1);
+ // Initialise letters
+ if (is_callable('mb_substr')) + $letter = mb_substr($chararray,0,1);
+ else
+ $letter = substr($chararray,0,1);
$letpos = 0;
$chararray .= '*'; while (1 == 1) { @@ -239,7 +245,10 @@ END; <?php $letpos++;
if ($letpos == strlen($chararray)) break;
- $letter = substr($chararray,$letpos,1); + if (is_callable('mb_substr'))
+ $letter = mb_substr($chararray,$letpos,1);
+ else
+ $letter = substr($chararray,$letpos,1); } ?> |