From 9ff51aafc518460e6c45996f09e9fe74e5f8d2e8 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 25 Jan 2018 22:26:47 +0100 Subject: Use index based string access for substr with length of 1 Signed-off-by: Morris Jobke --- lib/private/Avatar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private/Avatar.php') diff --git a/lib/private/Avatar.php b/lib/private/Avatar.php index b3df607a32b..4cacc801689 100644 --- a/lib/private/Avatar.php +++ b/lib/private/Avatar.php @@ -263,7 +263,7 @@ class Avatar implements IAvatar { * @return string */ private function generateAvatar($userDisplayName, $size) { - $text = strtoupper(substr($userDisplayName, 0, 1)); + $text = strtoupper($userDisplayName[0]); $backgroundColor = $this->avatarBackgroundColor($userDisplayName); $im = imagecreatetruecolor($size, $size); -- cgit v1.2.3