Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.13' into 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
webhdx committed Apr 1, 2020
2 parents 7474012 + 6325bca commit f21ecfa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/apache2/vhost.template
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
RewriteRule ^/(css|js|fonts?)/.*\.(css|js|otf|eot|ttf|svg|woff) - [L]

# Prevent access to website with direct usage of app.php in URL
RewriteRule ^/(.+/)?app\.php - [R=404,L]
RewriteRule ^/([^/]+/)?app\.php([/?#]|$) - [R=404,L]

RewriteRule .* /app.php
</IfModule>
Expand Down
2 changes: 1 addition & 1 deletion doc/nginx/ez_params.d/ez_rewrite_params
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rewrite "^/bundles/(.*)" "/bundles/$1" break;
rewrite "^/assets/(.*)" "/assets/$1" break;

# Prevent access to website with direct usage of app.php in URL
if ($request_uri ~ "^/(.+/)?app\.php") {
if ($request_uri ~ "^/([^/]+/)?app\.php([/?#]|$)") {
return 404;
}

Expand Down
8 changes: 0 additions & 8 deletions web/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@

$request = Request::createFromGlobals();

// Deny request if it contains the frontcontroller script ie. http://example.com/app.php
$frontControllerScript = preg_quote(basename($request->server->get('SCRIPT_FILENAME')));
if (preg_match("<^/([^/]+/)?$frontControllerScript([/?#]|$)>", $request->getRequestUri(), $matches) === 1) {
http_response_code(400);
echo('<html><head><title>400 Bad Request</title></head><body><h1>400 Bad Request</h1></center></body></html>');
die;
}

// If behind one or more trusted proxies, you can set them in SYMFONY_TRUSTED_PROXIES environment variable.
// !! Proxies here refers to load balancers, TLS/Reverse proxies and so on. Which Symfony need to know about to
// work correctly: identify https, allow Varnish to lookup fragment & user hash routes, get correct client ip, ...
Expand Down

0 comments on commit f21ecfa

Please sign in to comment.