diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-30 20:46:52 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-30 20:46:52 -0400 |
commit | 02cf50de80a952a4a41e29b45947ac794a8d6bb9 (patch) | |
tree | 1ecf55c323ae32d39db63988c508b34c12ee7023 /app/User | |
parent | fb642b76bb3d84b38c09f5d9dff8b51369eedaf2 (diff) | |
parent | 8e473a4fb49805ddce3c6833def78d5a2780b22f (diff) |
Merge pull-request #2267
Diffstat (limited to 'app/User')
-rw-r--r-- | app/User/Avatar/LetterAvatarProvider.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/User/Avatar/LetterAvatarProvider.php b/app/User/Avatar/LetterAvatarProvider.php index f9659e61..b7a95f41 100644 --- a/app/User/Avatar/LetterAvatarProvider.php +++ b/app/User/Avatar/LetterAvatarProvider.php @@ -144,12 +144,12 @@ class LetterAvatarProvider extends Base implements AvatarProviderInterface $str .= 'x'; $max = intval(9007199254740991 / $seed2); - for ($i = 0, $ilen = mb_strlen($str); $i < $ilen; $i++) { + for ($i = 0, $ilen = mb_strlen($str, 'UTF-8'); $i < $ilen; $i++) { if ($hash > $max) { $hash = intval($hash / $seed2); } - $hash = $hash * $seed + $this->getCharCode($str[$i]); + $hash = $hash * $seed + $this->getCharCode(mb_substr($str, $i, 1, 'UTF-8')); } return $hash; |