Skip to content

Commit 6a0fade

Browse files
Merge branch '4.4' into 5.1
* 4.4: [HttpClient] fix using proxies with NativeHttpClient [4.4] Ignore more deprecations for Mockery mocks [Routing] fix using !important and defaults/reqs in inline route definitions [ErrorHandler][DebugClassLoader] Do not check Mockery mocks classes [HttpClient] Fix using https with proxies [TwigBundle] Only remove kernel exception listener if twig is used Adjust expired range check Fix redis connection error message
2 parents d36e06e + 006b2d0 commit 6a0fade

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Route.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function getPath()
131131
public function setPath(string $pattern)
132132
{
133133
if (false !== strpbrk($pattern, '?<')) {
134-
$pattern = preg_replace_callback('#\{(\w++)(<.*?>)?(\?[^\}]*+)?\}#', function ($m) {
134+
$pattern = preg_replace_callback('#\{(!?\w++)(<.*?>)?(\?[^\}]*+)?\}#', function ($m) {
135135
if (isset($m[3][0])) {
136136
$this->setDefault($m[1], '?' !== $m[3] ? substr($m[3], 1) : null);
137137
}

Tests/RouteTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public function testInlineDefaultAndRequirement()
207207
$this->assertEquals((new Route('/foo/{bar}'))->setDefault('bar', null), new Route('/foo/{bar?}'));
208208
$this->assertEquals((new Route('/foo/{bar}'))->setDefault('bar', 'baz'), new Route('/foo/{bar?baz}'));
209209
$this->assertEquals((new Route('/foo/{bar}'))->setDefault('bar', 'baz<buz>'), new Route('/foo/{bar?baz<buz>}'));
210+
$this->assertEquals((new Route('/foo/{!bar}'))->setDefault('!bar', 'baz<buz>'), new Route('/foo/{!bar?baz<buz>}'));
210211
$this->assertEquals((new Route('/foo/{bar}'))->setDefault('bar', 'baz'), new Route('/foo/{bar?}', ['bar' => 'baz']));
211212

212213
$this->assertEquals((new Route('/foo/{bar}'))->setRequirement('bar', '.*'), new Route('/foo/{bar<.*>}'));

0 commit comments

Comments
 (0)