Fixed bug #10452: Evaluation PATH_INFO in tslib_fe::checkAlternativeIdMethods() sets...
authorOliver Hader <oliver.hader@typo3.org>
Wed, 18 Feb 2009 10:13:20 +0000 (10:13 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 18 Feb 2009 10:13:20 +0000 (10:13 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5031 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/simulatestatic/class.tx_simulatestatic.php

index e43d686..e34a4b9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-18  Oliver Hader  <oliver@typo3.org>
+
+       * Fixed bug #10452: Evaluation PATH_INFO in tslib_fe::checkAlternativeIdMethods() sets false positives and should be moved to tx_simulatestatic
+
 2009-02-17  Jeff Segars  <jeff@webempoweredchurch.org>
 
        * Follow-up for feature #10374: Add helper function for additional frontend editing controllers and views
index bbec4bc..3f331a2 100755 (executable)
@@ -757,21 +757,6 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
        function checkAlternativeIdMethods()    {
                $this->siteScript = t3lib_div::getIndpEnv('TYPO3_SITE_SCRIPT');
 
-                       // If PATH_INFO
-               if (t3lib_div::getIndpEnv('PATH_INFO')) {               // If pathinfo contains stuff...
-                       $parts=t3lib_div::trimExplode('/',t3lib_div::getIndpEnv('PATH_INFO'),1);
-                       $parts[]='html';
-                       $pCount = count($parts);
-                       if ($pCount>2)  {
-                               $this->type = intval($parts[$pCount-2]);
-                               $this->id = $parts[$pCount-3];
-                       } else {
-                               $this->type = 0;
-                               $this->id = $parts[0];
-                       }
-                       $this->absRefPrefix_force=1;
-               }
-
                        // Call post processing function for custom URL methods.
                if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc']))   {
                        $_params = array('pObj' => &$this);
index 7f28cfc..2a99593 100644 (file)
@@ -212,6 +212,20 @@ class tx_simulatestatic {
                                }
                        }
                }
+
+               // If PATH_INFO is defined as simulateStaticDocuments mode and has information:
+               if ($this->conf['mode'] === 'PATH_INFO' && t3lib_div::getIndpEnv('PATH_INFO')) {
+                       $parts = t3lib_div::trimExplode('/', t3lib_div::getIndpEnv('PATH_INFO'), true);
+                       $pCount = count($parts);
+                       if ($pCount > 1) {
+                               $parentObject->type = intval($parts[$pCount-1]);
+                               $parentObject->id = $parts[$pCount-2];
+                       } else {
+                               $parentObject->type = 0;
+                               $parentObject->id = $parts[0];
+                       }
+                       $parentObject->absRefPrefix_force = 1;
+               }
        }