Fixed bug #14021: Simplify the code to get nested GET Parameters with TS
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 15 Apr 2010 09:12:44 +0000 (09:12 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 15 Apr 2010 09:12:44 +0000 (09:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7369 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index a064edc..82fd4a2 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-15  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
+
+       * Fixed bug #14021: Simplify the code to get nested GET Parameters with TS
+
 2010-04-15  Benjamin Mack  <benni@typo3.org>
 
        * Release of TYPO3 4.4.0beta1
index db2c223..8e71d8b 100644 (file)
@@ -5572,24 +5572,18 @@ class tslib_cObj {
                        if ((string)$key!='')   {
                                $type = strtolower(trim($parts[0]));
                                switch($type) {
-                                       case 'gp':
                                        case 'gpvar':
-                                               list($firstKey, $rest) = explode('|', $key, 2);
-                                               if (strlen(trim($firstKey)))    {
-                                                       $retVal = t3lib_div::_GP(trim($firstKey));
-                                                               // Look for deeper levels:
-                                                       if (strlen(trim($rest)))        {
-                                                               $retVal = is_array($retVal) ? $this->getGlobal($rest, $retVal) : '';
-                                                       }
-                                                               // Check that output is not an array:
-                                                       if (is_array($retVal))  $retVal = '';
-                                               }
-                                               if ($type == 'gpvar') {
-                                                       t3lib_div::deprecationLog('Using gpvar in TypoScript getText is deprecated since TYPO3 4.3 - Use gp instead of gpvar.');
-                                               }
+                                               t3lib_div::deprecationLog('Using gpvar in TypoScript getText is deprecated since TYPO3 4.3 - Use gp instead of gpvar.');
+                                               // Fall Through
+                                       case 'gp':
+                                                       // Merge GET and POST and get $key out of the merged array
+                                               $retVal = $this->getGlobal(
+                                                       $key,
+                                                       t3lib_div::array_merge_recursive_overrule(t3lib_div::_GET(), t3lib_div::_POST())
+                                               );
                                        break;
                                        case 'tsfe':
-                                               $retVal = $this->getGlobal ('TSFE|'.$key);
+                                               $retVal = $this->getGlobal ('TSFE|' . $key);
                                        break;
                                        case 'getenv':
                                                $retVal = getenv($key);