Fixed bug #6125: MENU before/after* might create invalid HTML output (Thanks to Nabil...
authorBenni Mack <benni.mack@typo3.org>
Sat, 27 Jun 2009 11:20:37 +0000 (11:20 +0000)
committerBenni Mack <benni.mack@typo3.org>
Sat, 27 Jun 2009 11:20:37 +0000 (11:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5643 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_menu.php

index bff3319..5ae6847 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-27  Benjamin Mack  <benni@typo3.org>
+
+       * Fixed bug #6125: MENU before/after* might create invalid HTML output (Thanks to Nabil Saleh)
+
 2009-06-27  Christian Kuhn  <lolli@schwarzbu.ch>
 
        * Fixed bug #5061: Message in Web > List isn't localized (thanks to Christopher Stelmaszyk)
index 9bccd16..7896780 100644 (file)
@@ -1841,10 +1841,20 @@ class tslib_tmenu extends tslib_menu {
                                }
                        }
                        $GLOBALS['TSFE']->imagesOnPage[]=$imgInfo[3];
-                       $res='<img src="'.$GLOBALS['TSFE']->absRefPrefix.$imgInfo[3].'" width="'.$imgInfo[0].'" height="'.$imgInfo[1].'"'.$name.($this->I['val'][$pref.'ImgTagParams']?" ".$this->I['val'][$pref.'ImgTagParams']:'').tslib_cObj::getBorderAttr('border="0"');
-                       if (!strstr($res,'alt="'))      $res.=' alt=""';        // Adding alt attribute if not set.
+                       $res='<img' .
+                               ' src="' . $GLOBALS['TSFE']->absRefPrefix . $imgInfo[3] . '"' .
+                               ' width="' . $imgInfo[0] . '"' .
+                               ' height="' . $imgInfo[1] . '"' .
+                               $name .
+                               ($this->I['val'][$pref.'ImgTagParams'] ? ' ' . $this->I['val'][$pref.'ImgTagParams'] : '') .
+                               tslib_cObj::getBorderAttr(' border="0"');
+                       if (!strstr($res,'alt="')) {
+                               $res .= ' alt=""'; // Adding alt attribute if not set.
+                       }
                        $res.=' />';
-                       if ($this->I['val'][$pref.'ImgLink'])   {$res=$this->I['A1'].$res.$this->I['A2'];}
+                       if ($this->I['val'][$pref.'ImgLink']) {
+                               $res=$this->I['A1'].$res.$this->I['A2'];
+                       }
                }
                return $this->tmpl->wrap($res.$this->WMcObj->stdWrap($this->I['val'][$pref],$this->I['val'][$pref.'.']), $this->I['val'][$pref.'Wrap']);
        }