[BUGFIX] Avoid double encoding of routes 55/42355/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Fri, 7 Aug 2015 09:59:20 +0000 (11:59 +0200)
committerBenni Mack <benni@typo3.org>
Fri, 7 Aug 2015 10:06:27 +0000 (12:06 +0200)
The routing introduced in #65493 double encodes the routes for no reasons
Remove the double encoding and decoding.
Also improve type hints in the Router class

Resolves: #68828
Releases: master
Change-Id: I2576b122396280f87f75cb73ac38932936391d66
Reviewed-on: http://review.typo3.org/42355
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Routing/Router.php
typo3/sysext/backend/Classes/Routing/UriBuilder.php

index 1621b19..77d4bd2 100644 (file)
@@ -36,7 +36,7 @@ class Router implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * All routes used in the Backend
         *
-        * @var array|null
+        * @var Route[]
         */
        protected $routes = array();
 
@@ -53,7 +53,7 @@ class Router implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Fetch all registered routes, only use in UriBuilder
         *
-        * @return array|null
+        * @return Route[]
         */
        public function getRoutes() {
                return $this->routes;
@@ -67,7 +67,6 @@ class Router implements \TYPO3\CMS\Core\SingletonInterface {
         * @throws ResourceNotFoundException If the resource could not be found
         */
        public function match($pathInfo) {
-               $pathInfo = rawurldecode($pathInfo);
                foreach ($this->routes as $routeIdentifier => $route) {
                        // This check is done in a simple way as there are no parameters yet (get parameters only)
                        if ($route->getPath() === $pathInfo) {
index 7045bea..041573a 100644 (file)
@@ -82,7 +82,7 @@ class UriBuilder {
 
                // Add the Route path as &route=XYZ
                $parameters = array(
-                       'route' => rawurlencode($route->getPath())
+                       'route' => $route->getPath()
                ) + $parameters;
 
                return $this->buildUri($parameters, $referenceType);