[TASK] Switch content of render and __toString in Icon class 45/43145/2
authorFrank Nägler <frank.naegler@typo3.org>
Wed, 9 Sep 2015 07:27:58 +0000 (09:27 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 9 Sep 2015 07:54:14 +0000 (09:54 +0200)
Resolves: #69624
Releases: master
Change-Id: I44daabedf4fc1eada29a5748e8bc5ec32d9fd099
Reviewed-on: http://review.typo3.org/43145
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Imaging/Icon.php

index 550791d..bdc2dbc 100644 (file)
@@ -192,7 +192,11 @@ class Icon {
         * @return string
         */
        public function render() {
-               return $this->__toString();
+               $overlayIconMarkup = '';
+               if ($this->overlayIcon !== NULL) {
+                       $overlayIconMarkup = '<span class="icon-overlay icon-' . htmlspecialchars($this->overlayIcon->getIdentifier()) . '">' . $this->overlayIcon->getMarkup() . '</span>';
+               }
+               return str_replace('{overlayMarkup}', $overlayIconMarkup, $this->wrappedIcon());
        }
 
        /**
@@ -201,11 +205,7 @@ class Icon {
         * @return string
         */
        public function __toString() {
-               $overlayIconMarkup = '';
-               if ($this->overlayIcon !== NULL) {
-                       $overlayIconMarkup = '<span class="icon-overlay icon-' . htmlspecialchars($this->overlayIcon->getIdentifier()) . '">' . $this->overlayIcon->getMarkup() . '</span>';
-               }
-               return str_replace('{overlayMarkup}', $overlayIconMarkup, $this->wrappedIcon());
+               return $this->render();
        }
 
        /**