Fixed bug #15799: Uninitialized variables in t3lib (Thanks to Oliver Klee)
authorSusanne Moog <typo3@susannemoog.de>
Sat, 16 Oct 2010 17:41:42 +0000 (17:41 +0000)
committerSusanne Moog <typo3@susannemoog.de>
Sat, 16 Oct 2010 17:41:42 +0000 (17:41 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9100 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_frontendedit.php
t3lib/class.t3lib_fullsearch.php
t3lib/class.t3lib_pagerenderer.php
t3lib/class.t3lib_querygenerator.php
t3lib/class.t3lib_stdgraphic.php
t3lib/class.t3lib_treeview.php
t3lib/class.t3lib_tsparser_ext.php
t3lib/matchcondition/class.t3lib_matchcondition_frontend.php
typo3/alt_doc.php

index eff5bb4..0ea0792 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-10-16  Susanne Moog  <typo3@susanne-moog.de>
 
        * Fixed bug #15868: Provide function to open debug messages in a popup (Thanks to Stefan Galinski)
+       * Fixed bug #15799: Uninitialized variables in t3lib (Thanks to Oliver Klee)
 
 2010-10-16  Benjamin Mack  <benni@typo3.org>
 
index 995d8c3..595b7e7 100644 (file)
@@ -154,7 +154,7 @@ class t3lib_frontendedit {
                        if ($editClass) {
                                $edit = t3lib_div::getUserObj($editClass);
                                if (is_object($edit)) {
-                                       $content = $edit->editIcons($content, $params, $conf, $currentRecord, $dataArray, $addURLParamStr, $table, $editUid, $fieldList);
+                                       $content = $edit->editIcons($content, $params, $conf, $currentRecord, $dataArray, $addUrlParamStr, $table, $editUid, $fieldList);
                                }
                        }
                }
index de03b4c..04ac0f6 100644 (file)
@@ -507,13 +507,12 @@ class t3lib_fullsearch {
                                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
                                        if ($first)     {
                                                $xmlObj->setRecFields($table,implode(',',array_keys($row)));
-               //                              debug($xmlObj->XML_recFields);
                                                $first=0;
                                        }
                                        $valueArray = $row;
                                        if ($GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels'])     {
                                                foreach ($valueArray as $key => $val)   {
-                                                       $valueArray[$key] = $this->getProcessedValueExtra($table, $key, $val, $conf, ',');
+                                                       $valueArray[$key] = $this->getProcessedValueExtra($table, $key, $val, array(), ',');
                                                }
                                        }
                                        $xmlObj->addRecord($table, $valueArray);
@@ -849,6 +848,7 @@ class t3lib_fullsearch {
         */
        function makeValueList($fN, $fV, $conf, $table, $splitString) {
                $fieldSetup = $conf;
+               $out = '';
                if ($fieldSetup['type'] == 'files') {
                        $d = dir(PATH_site . $fieldSetup['uploadfolder']);
                        while (false !== ($entry = $d->read())) {
@@ -938,7 +938,7 @@ class t3lib_fullsearch {
                                                                }
                                                        }
                                                }
-                                               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+                                               $GLOBALS['TYPO3_DB']->sql_free_result($checkres);
                                        }
                                }
                        } else {
@@ -987,6 +987,7 @@ class t3lib_fullsearch {
                                        if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) {
                                                $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
                                                $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
+                                               $webMountPageTree = '';
                                                foreach($webMounts as $key => $val) {
                                                        if ($webMountPageTree) {
                                                                $webMountPageTreePrefix = ',';
@@ -1099,6 +1100,7 @@ class t3lib_fullsearch {
         * @return      [type]          ...
         */
        function csvRowTitles($row, $conf, $table)      {
+               $out = '';
                $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
                foreach ($row as $fN => $fV)    {
                        if (t3lib_div::inList($SET['queryFields'], $fN) || (!$SET['queryFields'] && $fN!='pid'))        {
@@ -1134,4 +1136,4 @@ class t3lib_fullsearch {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php'])       {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php']);
 }
-?>
\ No newline at end of file
+?>
index 6f45e61..b395ba1 100644 (file)
@@ -1021,7 +1021,7 @@ class t3lib_PageRenderer implements t3lib_Singleton {
                if (!isset($this->cssInline[$name]) && !empty($block)) {
                        $this->cssInline[$name] = array (
                                'code'       => $block,
-                               'compress'   => $compress,
+                               'compress'   => $compressed,
                                'forceOnTop' => $forceOnTop
                        );
                }
@@ -1810,4 +1810,4 @@ class t3lib_PageRenderer implements t3lib_Singleton {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']) {
        include_once ($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']);
 }
-?>
\ No newline at end of file
+?>
index 566dc8f..6789be2 100644 (file)
@@ -587,6 +587,7 @@ class t3lib_queryGenerator  {
 
                $c=0;
                $arrCount=0;
+               $loopcount = 0;
                foreach ($queryConfig as $key => $conf) {
                        $subscript = $parent.'['.$key.']';
                        $lineHTML = '';
@@ -724,9 +725,8 @@ class t3lib_queryGenerator  {
                        }
                        $loopcount = 1;
                }
-//             $codeArr[$arrCount] .='<input type="hidden" name="CMD" value="displayQuery">';
                $this->queryConfig = $queryConfig;
-//modifyHTMLColor($color,$R,$G,$B)
+
                return $codeArr;
        }
 
@@ -846,6 +846,7 @@ class t3lib_queryGenerator  {
                                $from_table_Arr[0] = $fieldSetup['foreign_table'];
                        }
                        $counter = 0;
+                       $webMountPageTree = '';
                        while (list(, $from_table) = each($from_table_Arr))     {
                                if (($useTablePrefix && !$dontPrefixFirstTable && $counter!=1) || $counter==1)  {
                                        $tablePrefix = $from_table.'_';
@@ -1008,7 +1009,7 @@ class t3lib_queryGenerator        {
                $out='<select name="'.$name.'" onChange="submit();">';
                $out.='<option value=""></option>';
                foreach ($this->fields as $key => $value) {
-                       if (!$fieldValue['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table.':'.$key)) {
+                       if (!$value['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $key)) {
                                $label = $this->fields[$key]['label'];
                                $label_alt = $this->fields[$key]['label_alt'];
                                $out .= '<option value="'.$prepend.$key.'"'.($key==$fieldName ? ' selected' : '').'>'.$label.'</option>';
@@ -1064,7 +1065,7 @@ class t3lib_queryGenerator        {
                $out.='<a href="#" onClick="document.forms[0][\''.$name.'\'].value=\'\';return false;">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => 'Clear list')) . '</a>';
                $out.='<BR><select name="_fieldListDummy" size="5" onChange="document.forms[0][\''.$name.'\'].value+=\',\'+this.value">';
                foreach ($this->fields as $key => $value) {
-                       if (!$fieldValue['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table.':'.$key)) {
+                       if (!$value['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $key)) {
                                $label = $this->fields[$key]['label'];
                                $label_alt = $this->fields[$key]['label_alt'];
                                $out .= '<option value="'.$key.'"'.($key==$fieldName ? ' selected':'').'>'.$label.'</option>';
@@ -1458,6 +1459,7 @@ class t3lib_queryGenerator        {
                if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) {
                        $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
                        $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
+                       $webMountPageTree = '';
                        foreach($webMounts as $key => $val) {
                                if ($webMountPageTree) {
                                        $webMountPageTreePrefix = ',';
index 1f40b3f..664aac7 100644 (file)
@@ -908,7 +908,6 @@ class t3lib_stdGraphic      {
                        $bits = explode(' ',$text);
                        foreach ($bits as $word) {
                                $word.=' ';
-                               $word = $word;
                                $wordInf = $this->ImageTTFBBoxWrapper($fontSize, $angle, $fontFile, $word, $splitRenderingConf ,$sF);
                                $wordW = ($wordInf[2]-$wordInf[0]);
                                $this->ImageTTFTextWrapper($im, $fontSize, $angle, $x, $y, $Fcolor, $fontFile, $word, $splitRenderingConf, $sF);
index 03fdd3d..6e05fe5 100644 (file)
@@ -765,6 +765,8 @@ class t3lib_treeView {
                $c = $this->getDataCount($res);
                $crazyRecursionLimiter = 999;
 
+               $idH = array();
+
                        // Traverse the records:
                while ($crazyRecursionLimiter>0 && $row = $this->getDataNext($res,$subCSSclass))        {
                        $a++;
index 8a6e8e2..f747fbb 100644 (file)
@@ -587,7 +587,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate   {
                }
                $a=0;
                $c=count($keyArr);
-               static $i;
+               static $i = 0;
                foreach ($keyArr as $key => $value) {
                        $HTML = '';
                        $a++;
index 6f9a659..f6e27ba 100644 (file)
@@ -169,7 +169,7 @@ class t3lib_matchCondition_frontend extends t3lib_matchCondition_abstract {
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['devices_class'])) {
                        foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['devices_class'] as $_classRef) {
                                $_procObj = t3lib_div::getUserObj($_classRef);
-                               return $_procObj->whichDevice_ext($useragent);
+                               return $_procObj->whichDevice_ext($userAgent);
                        }
                }
 
index ae11003..97909fc 100644 (file)
@@ -629,6 +629,7 @@ class SC_alt_doc {
                $this->newC=0;
                $thePrevUid='';
                $editForm='';
+               $trData = NULL;
 
                        // Traverse the GPvar edit array
                foreach($this->editconf as $table => $conf)     {       // Tables: