Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitb9f8a4f

Browse files
committed
minor#7759 Fix trusted hosts example regular expressions (thewilkybarkid)
This PR was merged into the 2.7 branch.Discussion----------Fix trusted hosts example regular expressionsAllow subdomains but not prefixed domains (eg evilexample.com).Commits-------e3f038b Fix trusted hosts example regular expressions
2 parents83ca87f +e3f038b commitb9f8a4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎reference/configuration/framework.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,14 @@ respond and the user will receive a 500 response.
362362
'trusted_hosts' => array('example.com', 'example.org'),
363363
));
364364
365-
Hosts can also be configured using regular expressions (e.g. ``.*\.?example.com$``),
365+
Hosts can also be configured using regular expressions (e.g. ``^(.+\.)?example.com$``),
366366
which make it easier to respond to any subdomain.
367367

368368
In addition, you can also set the trusted hosts in the front controller
369369
using the ``Request::setTrustedHosts()`` method::
370370

371371
// web/app.php
372-
Request::setTrustedHosts(array('.*\.?example.com$', '.*\.?example.org$'));
372+
Request::setTrustedHosts(array('^(.+\.)?example.com$', '^(.+\.)?example.org$'));
373373

374374
The default value for this option is an empty array, meaning that the application
375375
can respond to any given host.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp