[BUGFIX] Add RootPage to Slug Candidates 01/58901/3
authorAchim Fritz <af@achimfritz.de>
Thu, 15 Nov 2018 18:54:35 +0000 (19:54 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 16 Nov 2018 09:57:55 +0000 (10:57 +0100)
The slug candidates resolving now takes "/" into account,
allowing to find the root page as well. This way, the PageRouter
applies Route Enhancers to the root page as well,
so segments like "/my-news-plugin/" also applies to
"/".

Resolves: #86939
Releases: master
Change-Id: I56015e1d5bf4a8e9e12c4ebcef8bdc95e1d5c8e2
Reviewed-on: https://review.typo3.org/58901
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Steffen Dietrich <Teilzeitphilosoph@gmx.de>
Tested-by: Steffen Dietrich <Teilzeitphilosoph@gmx.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Routing/PageRouter.php

index 453bf8f..f6e0a9f 100644 (file)
@@ -425,6 +425,7 @@ class PageRouter implements RouterInterface
      * /home/about-us
      * /home/
      * /home
+     * /
      *
      * @param string $routePath
      * @return array
@@ -450,6 +451,7 @@ class PageRouter implements RouterInterface
             $candidatePathParts[] = $prefix;
             array_pop($pathParts);
         }
+        $candidatePathParts[] = '/';
         return $candidatePathParts;
     }