From: Alexander Ebert Date: Tue, 6 Sep 2016 14:49:01 +0000 (+0200) Subject: Use `height` attribute for smilies X-Git-Tag: 3.0.0_Beta_1~281^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=09fd981c5d342feafcd6b41005a30687ebe13918;p=GitHub%2FWoltLab%2FWCF.git Use `height` attribute for smilies --- diff --git a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php index 704e388f01..7ea25ef14b 100644 --- a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php +++ b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php @@ -70,8 +70,8 @@ class Smiley extends DatabaseObject { public function getHtml() { $srcset = ($this->smileyPath2x) ? ' srcset="' . StringUtil::encodeHTML($this->getURL2x()) . ' 2x"' : ''; - $style = ($this->getHeight()) ? ' style="height: ' . $this->getHeight() . 'px"' : ''; + $height = ($this->getHeight()) ? ' height="' . $this->getHeight() . '"' : ''; - return '' . StringUtil::encodeHTML($this->smileyCode) . ''; + return '' . StringUtil::encodeHTML($this->smileyCode) . ''; } } diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php index 9739473e07..d4f6a8f014 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php @@ -87,8 +87,8 @@ class HtmlInputNodeImg extends AbstractHtmlInputNode { // enforce database values for src, srcset and style $element->setAttribute('src', $smiley->getURL()); - if ($smiley->getHeight()) $element->setAttribute('style', 'height: ' . $smiley->getHeight() . 'px'); - else $element->removeAttribute('style'); + if ($smiley->getHeight()) $element->setAttribute('height', $smiley->getHeight()); + else $element->removeAttribute('height'); if ($smiley->smileyPath2x) $element->setAttribute('srcset', $smiley->getURL2x() . ' 2x'); else $element->removeAttribute('srcset'); diff --git a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeImg.class.php b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeImg.class.php index d2d9885d71..15a5e3bfe3 100644 --- a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeImg.class.php +++ b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeImg.class.php @@ -43,8 +43,8 @@ class HtmlOutputNodeImg extends AbstractHtmlOutputNode { // enforce database values for src, srcset and style $element->setAttribute('src', $smiley->getURL()); - if ($smiley->getHeight()) $element->setAttribute('style', 'height: ' . $smiley->getHeight() . 'px'); - else $element->removeAttribute('style'); + if ($smiley->getHeight()) $element->setAttribute('height', $smiley->getHeight()); + else $element->removeAttribute('height'); if ($smiley->smileyPath2x) $element->setAttribute('srcset', $smiley->getURL2x() . ' 2x'); else $element->removeAttribute('srcset');