8000 [Routing] Allow spaces in the script name for the apache dumper · symfony/symfony@77185e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 77185e0

Browse files
committed
[Routing] Allow spaces in the script name for the apache dumper
1 parent 6465a69 commit 77185e0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# skip "real" requests
2+
RewriteCond %{REQUEST_FILENAME} -f
3+
RewriteRule .* - [QSA,L]
4+
5+
# foo
6+
RewriteCond %{REQUEST_URI} ^/foo$
7+
RewriteRule .* ap\ p_d\ ev.php [QSA,L,E=_ROUTING__route:foo]

tests/Symfony/Tests/Component/Routing/Matcher/Dumper/ApacheMatcherDumperTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testDump()
3434
/**
3535
* @dataProvider provideEscapeFixtures
3636
*/
37-
public function testEscape($src, $dest, $char, $with, $message)
37+
public function testEscapePattern($src, $dest, $char, $with, $message)
3838
{
3939
$r = new \ReflectionMethod(new ApacheMatcherDumper($this->getRouteCollection()), 'escape');
4040
$r->setAccessible(true);
@@ -52,6 +52,14 @@ public function provideEscapeFixtures()
5252
);
5353
}
5454

55+
public function testEscapeScriptName()
56+
{
57+
$collection = new RouteCollection();
58+
$collection->add('foo', new Route('/foo'));
59+
$dumper = new ApacheMatcherDumper($collection);
60+
$this->assertStringEqualsFile(self::$fixturesPath.'/dumper/url_matcher2.apache', $dumper->dump(array('script_name' => 'ap p_d\ ev.php')));
61+
}
62+
5563
private function getRouteCollection()
5664
{
5765
$collection = new RouteCollection();

0 commit comments

Comments
 (0)
0