diff --git a/book/routing.rst b/book/routing.rst index 434f13840f2..5e5f7f1d5db 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -822,7 +822,7 @@ variables that are passed into the expression: Behind the scenes, expressions are compiled down to raw PHP. Our example would generate the following PHP in the cache directory:: - if (rtrim($pathinfo, '/contact') === '' && ( + if (0 === strpos($pathinfo, '/contact') && ( in_array($context->getMethod(), array(0 => "GET", 1 => "HEAD")) && preg_match("/firefox/i", $request->headers->get("User-Agent")) )) {