Fixed bug #16189: Optimize stdWrap usage for TypoScript content element CLEARGIF...
authorSteffen Kamper <info@sk-typo3.de>
Thu, 4 Nov 2010 00:11:21 +0000 (00:11 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 4 Nov 2010 00:11:21 +0000 (00:11 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9263 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/content/class.tslib_content_cleargif.php

index 4766100..da509f4 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-11-03  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16189: Optimize stdWrap usage for TypoScript content element CLEARGIF (Thanks to Jo Hasenau)
        * Fixed bug #16217: Regression : Typoscript "required" did not work anymore (Thanks to Jo Hasenau)
        * Fixed bug #16227: Optimize stdWrap usage for TypoScript content element HTML (Thanks to Jo Hasenau)
        * Fixed bug #16226: Optimize stdWrap usage for TypoScript content element HRULER (Thanks to Jo Hasenau)
index bbc4bb3..a08afc8 100644 (file)
@@ -42,18 +42,40 @@ class tslib_content_ClearGif extends tslib_content_Abstract {
         * @return      string          Output
         */
        public function render($conf = array()) {
-               $w = $this->cObj->stdWrap($conf['width'], $conf['width.']);
-               $h = $this->cObj->stdWrap($conf['height'], $conf['height.']);
-               $w = $w ? $w : 1;
-               $h = $h ? $h : 1;
-               $wrap = $conf['wrap'] ? $conf['wrap'] : '|<br />';
+
+               $width = isset($conf['width.'])
+                               ? $this->cObj->stdWrap($conf['width'], $conf['width.'])
+                               : $conf['width'];
+               if (!$width) {
+                       $width = 1;
+               }
+               $height = isset($conf['height.'])
+                               ? $this->cObj->stdWrap($conf['height'], $conf['height.'])
+                               : $conf['height'];
+               if (!$height) {
+                       $height = 1;
+               }
+               $wrap = isset($conf['wrap.'])
+                               ? $this->cObj->stdWrap($conf['wrap'], $conf['wrap.'])
+                               : $conf['wrap'];
+               if (!$wrap) {
+                       $wrap = '|<br />';
+               }
                $theValue = $this->cObj->wrap(
-                       '<img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . $w . '" height="' . $h . '"' .
-                       $this->cObj->getBorderAttr(' border="0"') . ' alt="" title="" />',
-                       $wrap
-               );
+                       '<img
+                       src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif"
+                       width="' . $width . '"
+                       height="' . $height . '"' .
+                       $this->cObj->getBorderAttr(' border="0"') . '
+                       alt="" />',
+                       $wrap);
+
+               if (isset($conf['stdWrap.'])) {
+                       $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
+               }
+
+               return $theValue;
 
-               return $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
        }
 
 }