Fixed bug #15104: Validation erros in tstemplate (Thanks to Georg Ringer)
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 8 Aug 2010 17:12:46 +0000 (17:12 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 8 Aug 2010 17:12:46 +0000 (17:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@8534 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tsparser_ext.php
typo3/sysext/tstemplate/ts/index.php
typo3/sysext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php
typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php

index 6459174..a1ba7ad 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 
 2010-08-08  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Fixed bug #15104: Validation erros in tstemplate (Thanks to Georg Ringer)
        * Fixed bug #15394: Improve t3lib_SpriteManager code comments
        * Fixed bug #7901: Workaround for PHP bug with Locale tr_TR (Thanks to Reinhard F├╝hricht)
 
index a88fa81..469dc25 100644 (file)
@@ -609,7 +609,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate   {
                                                : t3lib_iconWorks::getSpriteIcon('mimetypes-x-content-template-static', array('title' => $alttext))
                                        );
                        if (in_array($row['templateID'], $this->clearList_const) || in_array($row['templateID'], $this->clearList_setup)) {
-                               $A_B = '<a href="index.php?id=' . $GLOBALS['SOBE']->id . '&template=' . $row['templateID'] . '">';
+                               $A_B = '<a href="index.php?id=' . htmlspecialchars($GLOBALS['SOBE']->id . '&template=' . $row['templateID']) . '">';
                                $A_E = '</a>';
                                if (t3lib_div::_GP('template') == $row['templateID']) {
                                        $A_B = '<strong>' . $A_B;
@@ -619,12 +619,12 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                                $A_B = '';
                                $A_E = '';
                        }
-                       $HTML .= ($first ? '' : '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/ol/' . $PM . $BTM . '.gif" width="18" height="16" align="top" border="0" />') .
+                       $HTML .= ($first ? '' : '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/ol/' . $PM . $BTM . '.gif" width="18" height="16" align="top" border="0" alt="" />') .
                                 $icon .
                                $A_B . t3lib_div::fixed_lgd_cs($row['title'], $GLOBALS['BE_USER']->uc['titleLen']) . $A_E . '&nbsp;&nbsp;';
                        $RL = $this->ext_getRootlineNumber($row['pid']);
                        $keyArray[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
-                                                       <td nowrap>' . $HTML . '</td>
+                                                       <td nowrap="nowrap">' . $HTML . '</td>
                                                        <td align="center">' . ($row['root'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : '') . '&nbsp;&nbsp;</td>
                                                        <td align="center">' . ($row['clConf'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') :'') . '&nbsp;&nbsp;' . '</td>
                                                        <td align="center">' . ($row['clConst'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : '') . '&nbsp;&nbsp;' . '</td>
index 782f514..2a4e818 100644 (file)
@@ -355,9 +355,9 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
 
        function linkWrapTemplateTitle($title, $onlyKey = '') {
                if ($onlyKey) {
-                       $title = '<a href="index.php?id=' . $GLOBALS['SOBE']->id . '&e[' . $onlyKey . ']=1&SET[function]=tx_tstemplateinfo">' . htmlspecialchars($title) . '</a>';
+                       $title = '<a href="index.php?id=' . htmlspecialchars($GLOBALS['SOBE']->id . '&e[' . $onlyKey . ']=1&SET[function]=tx_tstemplateinfo') . '">' . htmlspecialchars($title) . '</a>';
                } else {
-                       $title = '<a href="index.php?id=' . $GLOBALS['SOBE']->id . '&e[constants]=1&e[config]=1&SET[function]=tx_tstemplateinfo">' . htmlspecialchars($title) . '</a>';
+                       $title = '<a href="index.php?id=' . htmlspecialchars($GLOBALS['SOBE']->id . '&e[constants]=1&e[config]=1&SET[function]=tx_tstemplateinfo') . '">' . htmlspecialchars($title) . '</a>';
                }
                return $title;
        }
index ba75f08..10e6504 100644 (file)
@@ -157,7 +157,7 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                                $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('constants', true), "", 0, 1);
                                $theOutput .= $this->pObj->doc->sectionEnd();
                                $theOutput .= '
-                                       <table border=0 cellpadding=1 cellspacing=0>
+                                       <table border="0" cellpadding="1" cellspacing="0">
                                ';
                                $tmpl->ext_lineNumberOffset = -2;       // Don't know why -2 and not 0... :-) But works.
                                $tmpl->ext_lineNumberOffset_mode = "const";
@@ -169,9 +169,9 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                                        if ($cVal == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') {
                                                $theOutput .= '
                                                        <tr>
-                                                               <td><img src="clear.gif" width="3" height="1" /></td><td class="bgColor2"><strong>' . htmlspecialchars($tmpl->templateTitles[$cVal]) . '</strong></td></tr>
+                                                               <td><img src="clear.gif" width="3" height="1" alt="" /></td><td class="bgColor2"><strong>' . htmlspecialchars($tmpl->templateTitles[$cVal]) . '</strong></td></tr>
                                                        <tr>
-                                                               <td><img src="clear.gif" width="3" height="1" /></td>
+                                                               <td><img src="clear.gif" width="3" height="1" alt="" /></td>
                                                                <td class="bgColor2"><table border="0" cellpadding="0" cellspacing="0" class="bgColor0" width="100%"><tr><td nowrap="nowrap">' .
                                                                $tmpl->ext_outputTS(array($val), $this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntaxBlockmode']) .
                                                                '</td></tr></table>
@@ -196,7 +196,7 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                                $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('setup', true), "", 0, 1);
                                $theOutput .= $this->pObj->doc->sectionEnd();
                                $theOutput .= '
-                                       <table border=0 cellpadding=1 cellspacing=0>
+                                       <table border="0" cellpadding="1" cellspacing="0">
                                ';
                                $tmpl->ext_lineNumberOffset = 0;
                                $tmpl->ext_lineNumberOffset_mode = "setup";
@@ -207,9 +207,9 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                                        if (current($tmpl->clearList_setup) == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') {
                                                $theOutput .= '
                                                        <tr>
-                                                               <td><img src="clear.gif" width="3" height="1" /></td><td class="bgColor2"><strong>' . htmlspecialchars($tmpl->templateTitles[current($tmpl->clearList_setup)]) . '</strong></td></tr>
+                                                               <td><img src="clear.gif" width="3" height="1" alt="" /></td><td class="bgColor2"><strong>' . htmlspecialchars($tmpl->templateTitles[current($tmpl->clearList_setup)]) . '</strong></td></tr>
                                                        <tr>
-                                                               <td><img src="clear.gif" width="3" height="1" /></td>
+                                                               <td><img src="clear.gif" width="3" height="1" alt="" /></td>
                                                                <td class="bgColor2"><table border="0" cellpadding="0" cellspacing="0" class="bgColor0" width="100%"><tr><td nowrap="nowrap">'.$tmpl->ext_outputTS(array($val),$this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'],$this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'],$this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'],$this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'],$this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntaxBlockmode']).'</td></tr></table>
                                                                </td>
                                                        </tr>
index ac03663..cff87b1 100644 (file)
@@ -85,9 +85,9 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                        $path = PATH_site.$GLOBALS['TCA']['sys_template']['columns']['resources']['config']['uploadfolder'].'/'.$v;
                        $functions = '';
                        if ($func)      {
-                               $functions = '<td bgcolor=red nowrap>' . $GLOBALS['LANG']->getLL('delete') . ' <input type="Checkbox" name="data[remove_resource]['.$k.']" value="'.htmlspecialchars($v).'"></td>';
-                               $functions.= '<td'.$bgcol.' nowrap>' . $GLOBALS['LANG']->getLL('toTop') . ' <input type="Checkbox" name="data[totop_resource]['.$k.']" value="'.htmlspecialchars($v).'"></td>';
-                               $functions.= '<td'.$bgcol.' nowrap>';
+                               $functions = '<td bgcolor="red" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('delete') . ' <input type="checkbox" name="data[remove_resource][' . $k . ']" value="' . htmlspecialchars($v) . '" /></td>';
+                               $functions . = '<td' . $bgcol . ' nowrap="nowrap">' . $GLOBALS['LANG']->getLL('toTop') . ' <input type="checkbox" name="data[totop_resource][' . $k . ']" value="' . htmlspecialchars($v) . '" /></td>';
+                               $functions .= '<td' . $bgcol . ' nowrap="nowrap">';
                                $fI = t3lib_div::split_fileref($v);
                                if (t3lib_div::inList($this->pObj->textExtensions,$fI['fileext']))      {
                                        $functions.= '<a href="index.php?id='.$this->pObj->id.'&e[file]='.rawurlencode($v).'">'.t3lib_iconWorks::getSpriteIcon('actions-document-open',array('title'=> $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:editFile', true))) . '</a>';
@@ -95,16 +95,16 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                $functions.= '</td>';
                        }
                        $thumb = t3lib_BEfunc::thumbCode(array('resources' => $v), 'sys_template', 'resources', $GLOBALS['BACK_PATH'], '');
-                       $out.= '<tr><td'.$bgcol.' nowrap>'.$v.'&nbsp;&nbsp;</td><td'.$bgcol.' nowrap>&nbsp;'.t3lib_div::formatSize(@filesize($path)).'&nbsp;</td>'.$functions.'<td'.$bgcol.'>'.trim($thumb).'</td></tr>';
+                       $out .= '<tr><td' . $bgcol . ' nowrap="nowrap">' . $v . '&nbsp;&nbsp;</td><td' . $bgcol . ' nowrap="nowrap">&nbsp;' . t3lib_div::formatSize(@filesize($path)) . '&nbsp;</td>' . $functions . '<td' . $bgcol . '>' . trim($thumb) . '</td></tr>';
                }
                if ($out)       {
                        if ($func)      {
-                               $out = '<table border=0 cellpadding=1 cellspacing=1 width="100%">'.$out.'</table>';
-                               $out = '<table border=0 cellpadding=0 cellspacing=0>
-                                       <tr><td class="bgColor2">'.$out.'<img src=clear.gif width=465 height=1></td></tr>
+                               $out = '<table border="0" cellpadding="1" cellspacing="1" width="100%">' . $out . '</table>';
+                               $out = '<table border="0" cellpadding="0" cellspacing="0">
+                                       <tr><td class="bgColor2">' . $out . '<img src="clear.gif" width="465px" height="1px"></td></tr>
                                </table>';
                        } else {
-                               $out = '<table border=0 cellpadding=0 cellspacing=0>'.$out.'</table>';
+                               $out = '<table border="0" cellpadding="0" cellspacing="0">' . $out . '</table>';
                        }
                }
                return $out;
@@ -128,10 +128,10 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                        if (t3lib_div::inList($this->pObj->textExtensions,strtolower($fI['extension'])))        {
                                $path = PATH_site.$GLOBALS['TCA']['sys_template']['columns']['resources']['config']['uploadfolder'].'/'.$v;
                                $thumb = t3lib_BEfunc::thumbCode(array('resources' => $v), 'sys_template', 'resources', $GLOBALS['BACK_PATH'], '');
-                               $out.= '<tr><td'.$bgcol.' nowrap>'.$v.'&nbsp;&nbsp;</td><td'.$bgcol.' nowrap>&nbsp;'.t3lib_div::formatSize(@filesize($path)).'&nbsp;</td><td'.$bgcol.'>'.trim($thumb).'</td><td><input type="Checkbox" name="data[makecopy_resource]['.$k.']" value="'.htmlspecialchars($v).'"></td></tr>';
+                               $out .= '<tr><td' . $bgcol . ' nowrap="nowrap">' . $v . '&nbsp;&nbsp;</td><td' . $bgcol . ' nowrap="nowrap">&nbsp;' . t3lib_div::formatSize(@filesize($path)) . '&nbsp;</td><td' . $bgcol . '>' . trim($thumb) . '</td><td><input type="Checkbox" name="data[makecopy_resource][' . $k . ']" value="' . htmlspecialchars($v) . '"></td></tr>';
                        }
                }
-               $out = ($out ? '<table border=0 cellpadding=0 cellspacing=0>'.$out.'</table>' : '');
+               $out = ($out ? '<table border="0" cellpadding="0" cellspacing="0">' . $out . '</table>' : '');
                return $out;
        }
 
index 4c836cb..c70f8a0 100644 (file)
@@ -491,15 +491,15 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
                        $theOutput .= $this->pObj->doc->sectionEnd();
                        $theOutput .= '<table border="0" cellpadding="1" cellspacing="0" id="typo3-objectBrowser" width="100%">
                                        <tr>
-                                               <td><img src=clear.gif width=4 height=1></td>
+                                               <td><img src="clear.gif" width="4px" height="1px" /></td>
                                                <td class="bgColor2">
-                                                       <table border=0 cellpadding=0 cellspacing=0 class="bgColor5" width="100%"><tr class="t3-row-header"><td nowrap width="99%"><strong>'.$label.'</strong></td>'.$remove.'</tr></table>
+                                                       <table border="0" cellpadding="0" cellspacing="0" class="bgColor5" width="100%"><tr class="t3-row-header"><td nowrap="nowrap" width="99%"><strong>' . $label . '</strong></td>' . $remove . '</tr></table>
                                                </td>
                                        </tr>
                                        <tr>
-                                               <td><img src=clear.gif width=4 height=1></td>
+                                               <td><img src="clear.gif" width="4px" height="1px" /></td>
                                                <td class="bgColor2">
-                                                       <table border=0 cellpadding=0 cellspacing=0 class="bgColor4" width="100%"><tr><td nowrap>'.$tree.'</td></tr></table></td>
+                                                       <table border="0" cellpadding="0" cellspacing="0" class="bgColor4" width="100%"><tr><td nowrap="nowrap">' . $tree . '</td></tr></table></td>
                                        </tr>
                                </table>
                        ';