From a75c0cbe62d79f06fb5129228f7849acb741e0f0 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 3 Oct 2019 10:56:05 +0300 Subject: [PATCH] Fixed wrong Grav param separator when using `Route` class --- CHANGELOG.md | 2 +- system/src/Grav/Common/Uri.php | 1 + system/src/Grav/Framework/Route/Route.php | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 713203d4c..f314fd890 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Flex: Removed extra exists check when creating object (messes up "non-existing" pages) * Support customizable null character replacement in `CSVFormatter::decode()` 1. [](#bugfix) + * Fixed wrong Grav param separator when using `Route` class # v1.7.0-beta.9 ## 09/26/2019 @@ -129,7 +130,6 @@ * Added support for [Clockwork](https://underground.works/clockwork) developer tools (now default debugger) * Added support for [Tideways XHProf](https://github.com/tideways/php-xhprof-extension) PHP Extension for profiling method calls * Added Twig profiling for Clockwork debugger - * Updated Symfony Components to 4.3 * Added support for Twig 2.11 (compatible with Twig 1.40+) * Optimization: Initialize debugbar only after the configuration has been loaded * Optimization: Combine some early Grav processors into a single one diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index e6c98029e..b7ad4181c 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -207,6 +207,7 @@ class Uri RouteFactory::setRoot($this->root_path); RouteFactory::setLanguage($language->getLanguageURLPrefix()); + RouteFactory::setParamValueDelimiter($config->get('system.param_sep')); } /** diff --git a/system/src/Grav/Framework/Route/Route.php b/system/src/Grav/Framework/Route/Route.php index 3002e1943..95a111c16 100644 --- a/system/src/Grav/Framework/Route/Route.php +++ b/system/src/Grav/Framework/Route/Route.php @@ -215,6 +215,10 @@ class Route return $new; } + /** + * @param string $language + * @return Route + */ public function withLanguage($language) { $new = $this->copy(); @@ -267,11 +271,17 @@ class Route return $this->withParam('queryParams', $param, $value); } + /** + * @return Route + */ public function withoutParams() { return $this->withoutGravParams()->withoutQueryParams(); } + /** + * @return Route + */ public function withoutGravParams() { $new = $this->copy(); @@ -280,6 +290,9 @@ class Route return $new; } + /** + * @return Route + */ public function withoutQueryParams() { $new = $this->copy();