Explicit type-casting for the image height
authorAlexander Ebert <ebert@woltlab.com>
Tue, 26 Jun 2018 10:17:00 +0000 (12:17 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 26 Jun 2018 10:17:00 +0000 (12:17 +0200)
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeImg.class.php

index 3d5e18b4765bf49e7a24228d1941933bfd526acd..ba7cdcdffd178bb629663bb938cd413575b22166 100644 (file)
@@ -174,7 +174,7 @@ class HtmlInputNodeImg extends AbstractHtmlInputNode {
                        // enforce database values for src, srcset and style
                        $element->setAttribute('src', $smiley->getURL());
                        
-                       if ($smiley->getHeight()) $element->setAttribute('height', $smiley->getHeight());
+                       if ($smiley->getHeight()) $element->setAttribute('height', (string)$smiley->getHeight());
                        else $element->removeAttribute('height');
                        
                        if ($smiley->smileyPath2x) $element->setAttribute('srcset', $smiley->getURL2x() . ' 2x');
index c60e6a409300c0e3df9778ee951f97042da17847..49d706e1b182beb4a6f9e8be581d0ae55967dfd4 100644 (file)
@@ -549,7 +549,7 @@ class HtmlInputNodeTextParser {
                                $element->setAttribute('src', $smiley->getURL());
                                $element->setAttribute('class', 'smiley');
                                $element->setAttribute('alt', $smileyCode);
-                               $element->setAttribute('height', $smiley->getHeight());
+                               $element->setAttribute('height', (string)$smiley->getHeight());
                                if ($smiley->getURL2x()) {
                                        $element->setAttribute('srcset', $smiley->getURL2x() . ' 2x');
                                }
index ac986f70d8d1576daed4330265531dc03c5d5dc8..641e3b633cb84cdf3327f9e7db2f84b4385a6488 100644 (file)
@@ -49,7 +49,7 @@ class HtmlOutputNodeImg extends AbstractHtmlOutputNode {
                                        // enforce database values for src, srcset and style
                                        $element->setAttribute('src', $smiley->getURL());
                                        
-                                       if ($smiley->getHeight()) $element->setAttribute('height', $smiley->getHeight());
+                                       if ($smiley->getHeight()) $element->setAttribute('height', (string)$smiley->getHeight());
                                        else $element->removeAttribute('height');
                                        
                                        if ($smiley->smileyPath2x) $element->setAttribute('srcset', $smiley->getURL2x() . ' 2x');