[BUGFIX] Fix regression in prefixLocalAchors feature 89/35989/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 12 Jan 2015 17:23:49 +0000 (18:23 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 13 Jan 2015 12:43:55 +0000 (13:43 +0100)
The security fix for #62723 missed an edge case were the
TypoScriptFrontendController main cObj property is not yet initialized.

Check for this case and create it.

Resolves: #63896
Releases: 4.5, 6.2, master
Change-Id: Ief9338453517e095d120007d8d13ba6405d6fbb8
Reviewed-on: http://review.typo3.org/35989
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Oliver Gassner <og@plan2.net>
Reviewed-by: georg kuehnberger <gk@plan2.net>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Peter Niederlag <peter.niederlag@typo3.org>
Tested-by: Peter Niederlag <peter.niederlag@typo3.org>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index f100272..3b3b543 100644 (file)
@@ -4103,6 +4103,9 @@ class TypoScriptFrontendController {
         */
        public function prefixLocalAnchorsWithScript() {
                if (!$this->beUserLogin) {
+                       if (!is_object($this->cObj)) {
+                               $this->newCObj();
+                       }
                        $scriptPath = $this->cObj->getUrlToCurrentLocation();
                } else {
                        // To break less existing sites, we allow the REQUEST_URI to be used for the prefix