Add width/height properties for default avatars (#2555)
authorSascha Greuel <sascha@softcreatr.de>
Sat, 19 May 2018 18:47:44 +0000 (20:47 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 19 May 2018 18:47:44 +0000 (20:47 +0200)
* Added width/height properties for default avatars

Under certain circumstances, it is possible, that a browser strips the style tag on SVG images. This leads to a display of very tiny avatar images as shown below:

Since `width` and `height` are valid properties and respected by every browser, it's not the worst idea to include them.

* Removed redundant style attribute

wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php

index 67d58710cee1d17c8ea07e0aaaf07d70c7ec2102..b80bfbec36c0bb8f60eb8c67ef83ee8f3bacf47f 100644 (file)
@@ -79,7 +79,7 @@ SVG;
        public function getImageTag($size = null) {
                if ($size === null) $size = $this->size;
                
-               return '<img src="'.StringUtil::encodeHTML($this->getURL($size)).'" style="width: '.$size.'px; height: '.$size.'px" alt="" class="userAvatarImage">';
+               return '<img src="'.StringUtil::encodeHTML($this->getURL($size)).'" width="'.$size.'" height="'.$size.'" alt="" class="userAvatarImage">';
        }
        
        /**