Fix encoding issue with default avatars
authorMatthias Schmidt <gravatronics@live.com>
Mon, 15 May 2017 17:39:55 +0000 (19:39 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 15 May 2017 17:39:55 +0000 (19:39 +0200)
wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php

index 1fa5e815292d9c4d137b9ad54184b18aacddbc99..ded97a0cc96c1f284df248ef52068be6efb18a00 100644 (file)
@@ -42,6 +42,8 @@ class DefaultAvatar implements IUserAvatar {
                                $text = mb_strtoupper(mb_substr($username, 0, 2));
                        }
                        
+                       $text = htmlspecialchars($text, ENT_XML1, 'UTF-8');
+                       
                        $backgroundColor = substr(sha1($username), 0, 6);
                        
                        $perceptiveLuminance = $this->getPerceptiveLuminance(