Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2731d72

Browse filesBrowse files
committed
minor symfony#4343 Compiled PHP for customized route matching (GeertDD)
This PR was submitted for the master branch but it was merged into the 2.4 branch instead (closes symfony#4343). Discussion ---------- Compiled PHP for customized route matching The second parameter of `rtrim()` is a character mask. By checking if `rtrim($pathinfo, '/contact') === ''`, `$pathinfo` could be any URL containing those characters and not only "/contact" which was configured as the route path, for example: $pathinfo = '/octocat'; var_dump(rtrim($pathinfo, '/contact') === ''); // bool(true) Commits ------- fb5e820 Compiled PHP for customized route matching
2 parents 228111b + fb5e820 commit 2731d72
Copy full SHA for 2731d72

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎book/routing.rst

Copy file name to clipboardExpand all lines: book/routing.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ variables that are passed into the expression:
833833
Behind the scenes, expressions are compiled down to raw PHP. Our example
834834
would generate the following PHP in the cache directory::
835835

836-
if (rtrim($pathinfo, '/contact') === '' && (
836+
if (0 === strpos($pathinfo, '/contact') && (
837837
in_array($context->getMethod(), array(0 => "GET", 1 => "HEAD"))
838838
&& preg_match("/firefox/i", $request->headers->get("User-Agent"))
839839
)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.