Only in typo3_src.new/: bug_1234.diff
diff -ru typo3_src.orig/t3lib/class.t3lib_tsparser_ext.php typo3_src.new/t3lib/class.t3lib_tsparser_ext.php
--- typo3_src.orig/t3lib/class.t3lib_tsparser_ext.php	2010-02-28 12:09:18.000000000 +0100
+++ typo3_src.new/t3lib/class.t3lib_tsparser_ext.php	2010-02-28 12:32:49.460659543 +0100
@@ -192,7 +192,7 @@
 		if (is_array($setupArray))	{
 			$this->getFileName_backPath=PATH_site;		// Setting absolute prefixed path for relative resources.
 			reset($setupArray);
-			while(list($key,$val)=each($setupArray))	{
+			foreach($setupArray as $key => $val) {
 				if ($prefix || substr($key,0,16)!='TSConstantEditor')	{		// We don't want 'TSConstantEditor' in the flattend setup.
 					if (is_array($val))	{
 						$this->flattenSetup($val,$prefix.$key, ($key=='file.'));
@@ -299,7 +299,7 @@
 		$c=0;
 		$cc=count($this->constants);
 		reset($this->constants);
-		while (list(,$str)=each($this->constants))	{
+		foreach($this->constants as $str) {
 			$c++;
 			if ($c==$cc)	{
 				if (strstr($str,$this->edit_divider))	{
@@ -366,7 +366,7 @@
 		}
 		$keyArr_num=array();
 		$keyArr_alpha=array();
-		while (list($key,)=each($arr))	{
+		foreach($arr as $key) {
 			if (substr($key,-2)!='..')	{	// Don't do anything with comments / linenumber registrations...
 				$key=preg_replace('/\.$/','',$key);
 				if (substr($key,-1)!='.')	{
@@ -384,7 +384,7 @@
 		$c=count($keyArr);
 		if ($depth_in)	{$depth_in = $depth_in.'.';}
 
-		while (list($key,)=each($keyArr))	{
+		foreach($keyArr as $key) {
 			$a++;
 			$depth=$depth_in.$key;
 			if ($this->bType!='const' || substr($depth,0,1)!='_')	{		// this excludes all constants starting with '_' from being shown.
@@ -509,7 +509,7 @@
 	function ext_getSearchKeys($arr, $depth_in, $searchString, $keyArray)		{
 		reset($arr);
 		$keyArr=array();
-		while (list($key,)=each($arr))	{
+		foreach($arr as $key) {
 			$key=preg_replace('/\.$/','',$key);
 			if (substr($key,-1)!='.')	{
 				$keyArr[$key]=1;
@@ -518,7 +518,7 @@
 		reset($keyArr);
 		$c=count($keyArr);
 		if ($depth_in)	{ $depth_in = $depth_in.'.'; }
-		while (list($key,)=each($keyArr))	{
+		foreach($keyArr as $key) {
 			$depth=$depth_in.$key;
 			$deeper = is_array($arr[$key.'.']);
 
@@ -564,7 +564,7 @@
 	function ext_getRootlineNumber($pid)	{
 		if ($pid && is_array($GLOBALS['rootLine']))	{
 			reset($GLOBALS['rootLine']);
-			while(list($key,$val)=each($GLOBALS['rootLine']))	{
+			foreach($GLOBALS['rootLine']) as $key => $val) {
 				if ($val['uid']==$pid)	return $key;
 			}
 		}
@@ -582,7 +582,7 @@
 	function ext_getTemplateHierarchyArr($arr,$depthData, $keyArray,$first=0)	{
 		reset($arr);
 		$keyArr=array();
-		while (list($key,)=each($arr))	{
+		foreach($arr as $key) {
 			$key=preg_replace('/\.$/','',$key);
 			if (substr($key,-1)!='.')	{
 				$keyArr[$key]=1;
@@ -592,7 +592,7 @@
 		$a=0;
 		$c=count($keyArr);
 		static $i;
-		while (list($key,)=each($keyArr))	{
+		foreach($keyArr as $key) {
 			$HTML = '';
 			$a++;
 			$deeper = is_array($arr[$key . '.']);
@@ -680,7 +680,7 @@
 	function ext_outputTS($config, $lineNumbers=0, $comments=0, $crop=0, $syntaxHL=0, $syntaxHLBlockmode=0)	{
 		$all='';
 		reset($config);
-		while (list(,$str)=each($config))	{
+		foreach($config as $str) {
 			$all .= chr(10) .'[GLOBAL]' . chr(10) . $str;
 		}
 
@@ -745,7 +745,7 @@
 		reset($cArr);
 		$n = ceil(log10(count($cArr)+$this->ext_lineNumberOffset));
 		$lineNum='';
-		while(list($k,$v)=each($cArr))	{
+		foreach($cArr as $k => $v) {
 			$lln=$k+$this->ext_lineNumberOffset+1;
 			if ($ln)	$lineNum = $this->ext_lnBreakPointWrap($lln,str_replace(' ','&nbsp;',sprintf('% '.$n.'d',$lln))).':   ';
 			$v=htmlspecialchars($v);
@@ -820,15 +820,15 @@
 	function ext_compareFlatSetups($default)	{
 		$editableComments=array();
 		reset($this->flatSetup);
-		while(list($const,$value)=each($this->flatSetup))	{
+		foreach($this->flatSetup as $const => $value) {
 			if (substr($const,-2)!='..' && isset($this->flatSetup[$const.'..']))	{
 				$comment = trim($this->flatSetup[$const.'..']);
-				$c_arr = explode(chr(10),$comment);
-				while(list($k,$v)=each($c_arr))	{
+				$cArr = explode(chr(10),$comment);
+				foreach($cArr as $k => $v) {
 					$line=trim(preg_replace('/^[#\/]*/','',$v));
 					if ($line)	{
 						$parts = explode(';', $line);
-						while(list(,$par)=each($parts))		{
+						foreach($parts as $par) {
 							if (strstr($par,'='))	{
 								$keyValPair =explode('=',$par,2);
 								switch(trim(strtolower($keyValPair[0])))	{
@@ -894,13 +894,13 @@
 	function ext_categorizeEditableConstants($editConstArray)	{
 		// Runs through the available constants and fills the $this->categories array with pointers and priority-info
 		reset($editConstArray);
-		while(list($constName,$constData)=each($editConstArray))	{
+		foreach($editConstArray as $constName => $constData) {
 			if (!$constData['type']) {
 				$constData['type']='string';
 			}
 			$cats = explode(',',$constData['cat']);
 			reset($cats);
-			while (list(,$theCat)=each($cats))	{		// if = only one category, while allows for many. We have agreed on only one category is the most basic way...
+			foreach($cats as $theCat) {		// if = only one category, while allows for many. We have agreed on only one category is the most basic way...
 				$theCat=trim($theCat);
 				if ($theCat)	{
 					$this->categories[$theCat][$constName]=$constData['subcat'];
@@ -917,7 +917,7 @@
 	function ext_getCategoryLabelArray()	{
 		// Returns array used for labels in the menu.
 		$retArr = array();
-		while(list($k,$v)=each($this->categories))	{
+		foreach($this->categories as $k => $v) {
 			if (count($v))	{
 				$retArr[$k]=strtoupper($k).' ('.count($v).')';
 			}
@@ -977,7 +977,7 @@
 		$out=array();
 		if (is_array($catConf))	{
 			reset($catConf);
-			while(list($key,$val)=each($catConf))	{
+			foreach($catConf as $key => $val) {
 				switch($key)	{
 					case 'image':
 						$out['imagetag'] = $this->ext_getTSCE_config_image($catConf['image']);
@@ -1048,7 +1048,7 @@
 	function ext_resourceDims()	{
 		if ($this->setup['resources'])	{
 			$rArr=explode(',',$this->setup['resources']);
-			while(list($c,$val)=each($rArr))	{
+			foreach($rArr as $c => $val) {
 				$val=trim($val);
 				$theFile = PATH_site.'uploads/tf/'.$val;
 				if ($val && @is_file($theFile))	{
@@ -1060,7 +1060,7 @@
 			}
 		}
 		reset($this->dirResources);
-		while(list($c,$val)=each($this->dirResources))	{
+		foreach($this->dirResources as $c => $val) {
 			$val=trim($val);
 			$imgInfo = @getimagesize(PATH_site.$val);
 			if (is_array($imgInfo))	{
@@ -1144,7 +1144,7 @@
 			$this->rArr=explode(',',$this->setup['resources'].','.implode($this->dirResources,','));
 
 			if (!$this->doNotSortCategoriesBeforeMakingForm) asort($this->categories[$category]);
-			while(list($name,$type)=each($this->categories[$category]))	{
+			foreach($this->categories[$category] as $name => $type) {
 				$params = $theConstants[$name];
 				if (is_array($params))	{
 					if ($subcat!=$params['subcat_name'])	{
@@ -1190,7 +1190,7 @@
 						case 'color':
 							$colorNames=explode(',',','.$this->HTMLcolorList);
 							$p_field='';
-							while(list(,$val)=each($colorNames))	{
+							foreach($colorNames as $val) {
 								$sel='';
 								if ($val==strtolower($params['value'])) {
 									$sel = ' selected';
@@ -1224,7 +1224,7 @@
 						case 'options':
 							if (is_array($typeDat['params']))	{
 								$p_field='';
-								while(list(,$val)=each($typeDat['params']))	{
+								foreach($typeDat['params'] as $val) {
 									$vParts = explode('=',$val,2);
 									$label = $vParts[0];
 									$val = isset($vParts[1]) ? $vParts[1] : $vParts[0];
@@ -1528,7 +1528,7 @@
 	function ext_depthKeys($arr,$settings)	{
 		reset($arr);
 		$tsbrArray=array();
-		while(list($theK,$theV)=each($arr))	{
+		foreach($arr as $theK => $theV) {
 			$theKeyParts = explode('.',$theK);
 			$depth='';
 			$c=count($theKeyParts);
@@ -1541,7 +1541,7 @@
 		}
 			// Modify settings
 		reset($tsbrArray);
-		while(list($theK,$theV)=each($tsbrArray))	{
+		foreach($tsbrArray as $theK => $theV) {
 			if ($theV)	{
 				$settings[$theK] = 1;
 			} else {
@@ -1572,7 +1572,7 @@
 
 		if (is_array($data))	{
 			reset($data);
-			while(list($key,$var)=each($data))	{
+			foreach($data as $key => $var) {
 				if (isset($theConstants[$key]))	{
 					if ($this->ext_dontCheckIssetValues || isset($check[$key]))	{		// If checkbox is set, update the value
 						list($var) = explode(chr(10),$var);	// exploding with linebreak, just to make sure that no multiline input is given!
@@ -1680,7 +1680,7 @@
 			// Remaining keys in $check indicates fields that are just clicked "on" to be edited. Therefore we get the default value and puts that in the template as a start...
 		if (!$this->ext_dontCheckIssetValues && is_array($check))	{
 			reset($check);
-			while(list($key,$var)=each($check))	{
+			foreach($check as $key => $var) {
 				if (isset($theConstants[$key]))	{
 					$dValue = $theConstants[$key]['default_value'];
 					$this->ext_putValueInConf($key, $dValue);
@@ -1750,7 +1750,7 @@
 	function ext_prevPageWithTemplate($id,$perms_clause)	{
 		$rootLine = t3lib_BEfunc::BEgetRootLine($id,$perms_clause?' AND '.$perms_clause:'');
 		reset($rootLine);
-		while(list(,$p)=each($rootLine))	{
+		foreach($rootLine as $p) {
 			if ($this->ext_getFirstTemplate($p['uid']))	{
 				return $p;
 			}
