Skip to content

Commit da86615

Browse files
committed
MDL-82652 core: Fix upstream bug in nikic/fast-route
See the following upstream issues for further information: - nikic/FastRoute#292 - nikic/FastRoute#293
1 parent dacef96 commit da86615

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Instructions to import/update nikic/fast-route into Moodle:
2+
3+
1. Update any dependencies
4+
2. Download the latest release from https://github.com/nikic/fast-route
5+
3. Replace the files in nikic/fast-route with those in the zip
6+
7+
Moodle-specific patches
8+
* Fixed a bug in unlimited optional placeholders: https://github.com/nikic/FastRoute/pull/293

lib/nikic/fast-route/src/RouteCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(RouteParser $routeParser, DataGenerator $dataGenerat
3838
public function addRoute($httpMethod, $route, $handler)
3939
{
4040
$route = $this->currentGroupPrefix . $route;
41-
$routeDatas = $this->routeParser->parse($route);
41+
$routeDatas = array_reverse($this->routeParser->parse($route));
4242
foreach ((array) $httpMethod as $method) {
4343
foreach ($routeDatas as $routeData) {
4444
$this->dataGenerator->addRoute($method, $routeData, $handler);

0 commit comments

Comments
 (0)