Revert "[TASK] Fix TYPO3.ControlStructures.DisallowEachInLoopCondition"
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 21 Sep 2012 22:02:32 +0000 (00:02 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 21 Sep 2012 22:02:53 +0000 (00:02 +0200)
This reverts commit 8103ab1003276c3bf036b90431b9d48eb7473036

Change-Id: I351240bd1b35722b40f83b6f16fce9b10e7ba992
Reviewed-on: http://review.typo3.org/14892
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/class.t3lib_readmail.php
typo3/sysext/core/Classes/Database/QueryGenerator.php
typo3/sysext/core/Classes/Database/QueryView.php
typo3/sysext/core/Classes/Html/HtmlParser.php
typo3/sysext/core/Classes/Utility/MathUtility.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/install/Classes/Installer.php
typo3/sysext/rtehtmlarea/Classes/Controller/SpellCheckingController.php
typo3/sysext/statictemplates/media/scripts/plaintextLib.inc

index b2e79ef..367766a 100644 (file)
@@ -145,7 +145,7 @@ class t3lib_readmail {
                $cTypes = array();
                $cTypes['ContentType'] = $parts[0];
                next($parts);
-               foreach ($parts as $ppstr) {
+               while (list(, $ppstr) = each($parts)) {
                        $mparts = explode('=', $ppstr, 2);
                        if (count($mparts) > 1) {
                                $cTypes[strtolower(trim($mparts[0]))] = preg_replace('/^"/', '', trim(preg_replace('/"$/', '', trim($mparts[1]))));
index 8502605..436dca4 100644 (file)
@@ -860,7 +860,7 @@ class QueryGenerator {
                        }
                        $counter = 0;
                        $webMountPageTree = '';
-                       foreach ($from_table_Arr as $from_table) {
+                       while (list(, $from_table) = each($from_table_Arr)) {
                                if ($useTablePrefix && !$dontPrefixFirstTable && $counter != 1 || $counter == 1) {
                                        $tablePrefix = $from_table . '_';
                                }
index 169bf2e..a175099 100644 (file)
@@ -774,7 +774,7 @@ class QueryView {
                        }
                        $d->close();
                        natcasesort($fileArray);
-                       foreach ($fileArray as $fileName) {
+                       while (list(, $fileName) = each($fileArray)) {
                                if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($fV, $fileName) || $fV == $fileName) {
                                        if (!$out) {
                                                $out = htmlspecialchars($fileName);
index 4584c27..872100d 100644 (file)
@@ -332,7 +332,7 @@ class HtmlParser {
                $nested = 0;
                reset($parts);
                next($parts);
-               foreach ($parts as $k => $v) {
+               while (list($k, $v) = each($parts)) {
                        $isEndTag = substr($content, $pointer, 2) == '</' ? 1 : 0;
                        $tagLen = strcspn(substr($content, $pointer), '>') + 1;
                        // We meet a start-tag:
@@ -434,7 +434,7 @@ class HtmlParser {
                $newParts[] = $parts[0];
                reset($parts);
                next($parts);
-               foreach ($parts as $k => $v) {
+               while (list($k, $v) = each($parts)) {
                        $tagLen = strcspn(substr($content, $pointer), '>') + 1;
                        // Set tag:
                        // New buffer set and pointer increased
@@ -711,7 +711,7 @@ class HtmlParser {
                $tagStack = array();
                $inComment = FALSE;
                $skipTag = FALSE;
-               foreach ($tokArr as $tok) {
+               while (list(, $tok) = each($tokArr)) {
                        if ($inComment) {
                                if (($eocPos = strpos($tok, '-->')) === FALSE) {
                                        // End of comment is not found in the token. Go further until end of comment is found in other tokens.
@@ -1172,7 +1172,7 @@ class HtmlParser {
                $contentParts = explode('&lt;', $content);
                next($contentParts);
                // bypass the first
-               foreach ($contentParts as $k => $tok) {
+               while (list($k, $tok) = each($contentParts)) {
                        $firstChar = substr($tok, 0, 1);
                        if (strcmp(trim($firstChar), '')) {
                                $subparts = explode('&gt;', $tok, 2);
index f77da62..0a9d6b7 100644 (file)
@@ -115,7 +115,7 @@ final class MathUtility {
                $buffer = doubleval(current($reg[2]));
                // Advance pointer
                next($reg[2]);
-               foreach ($reg[2] as $k => $v) {
+               while (list($k, $v) = each($reg[2])) {
                        $v = doubleval($v);
                        $sign = $reg[1][$k];
                        if ($sign == '+' || $sign == '-') {
index 31e9ba7..a8c0d3a 100644 (file)
@@ -5172,10 +5172,7 @@ class ContentObjectRenderer {
                }
                $retVal = '';
                $sections = explode('//', $string);
-               foreach ($sections as $secKey => $secVal) {
-                       if ($retVal) {
-                               break;
-                       }
+               while (!$retVal and list($secKey, $secVal) = each($sections)) {
                        $parts = explode(':', $secVal, 2);
                        $key = trim($parts[1]);
                        if ((string) $key != '') {
index 88431af..65114eb 100644 (file)
@@ -2597,8 +2597,9 @@ REMOTE_ADDR was \'' . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE
                        $rows = array();
                        foreach ($this->config_array['im_versions'] as $p => $v) {
                                $ka = array();
-                               foreach ($v as $key => $value) {
-                                       $ka[] = $key;
+                               reset($v);
+                               while (list($ka[]) = each($v)) {
+
                                }
                                // Define the markers content
                                $rowsMarkers = array(
index 057c129..0a02622 100644 (file)
@@ -520,7 +520,7 @@ var selectedDictionary = "' . $this->dictionary . '";
                $incurrent = array();
                $stringText = $string;
                $words = preg_split($this->parserCharset == 'utf-8' ? '/\\P{L}+/u' : '/\\W+/', $stringText);
-               foreach ($words as $word) {
+               while (list(, $word) = each($words)) {
                        $word = preg_replace('/ /' . ($this->parserCharset == 'utf-8' ? 'u' : ''), '', $word);
                        if ($word && !is_numeric($word)) {
                                if ($this->pspell_is_available && !$this->forceCommandMode) {
index 97f9001..3ced4fc 100644 (file)
@@ -503,7 +503,7 @@ class user_plaintext {
                if ($this->conf['images.']['header']) {
                        $lines[] = $this->getString($this->conf['images.']['header']);
                }
-               foreach ($images as $k => $file) {
+               while (list($k, $file) = each($images)) {
                        $lines[] = ($this->siteUrl . $upload_path) . $file;
                        if ($links && count($linksArr) > 1) {
                                if (isset($linksArr[$k])) {