mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX Incorrect env setting in 3.1.13
This commit is contained in:
parent
dac1b5818b
commit
0319f7855b
@ -94,7 +94,10 @@ function stripslashes_recursively(&$array) {
|
|||||||
if(!defined('TRUSTED_PROXY')) {
|
if(!defined('TRUSTED_PROXY')) {
|
||||||
$trusted = true; // will be false by default in a future release
|
$trusted = true; // will be false by default in a future release
|
||||||
|
|
||||||
if(getenv('BlockUntrustedIPs') || defined('SS_TRUSTED_PROXY_IPS')) {
|
if(getenv('BlockUntrustedProxyHeaders') // Legacy setting (reverted from documentation)
|
||||||
|
|| getenv('BlockUntrustedIPs') // Documented setting
|
||||||
|
|| defined('SS_TRUSTED_PROXY_IPS')
|
||||||
|
) {
|
||||||
$trusted = false;
|
$trusted = false;
|
||||||
|
|
||||||
if(defined('SS_TRUSTED_PROXY_IPS') && SS_TRUSTED_PROXY_IPS !== 'none') {
|
if(defined('SS_TRUSTED_PROXY_IPS') && SS_TRUSTED_PROXY_IPS !== 'none') {
|
||||||
|
@ -509,15 +509,15 @@ If only trusted servers will make requests then you can use '*' to trust all cli
|
|||||||
Otherwise a comma separated list of individual IP addresses should be declared.
|
Otherwise a comma separated list of individual IP addresses should be declared.
|
||||||
|
|
||||||
This behaviour is enabled whenever SS_TRUSTED_PROXY_IPS is defined, or if the
|
This behaviour is enabled whenever SS_TRUSTED_PROXY_IPS is defined, or if the
|
||||||
`BlockUntrustedProxyHeaders` environment variable is declared. From 3.1.13 onwards
|
`BlockUntrustedIPs` environment variable is declared. It is advisable to include the
|
||||||
this environment variable is included in the installer by default.
|
following in your .htaccess to ensure this behaviour is activated.
|
||||||
|
|
||||||
|
|
||||||
<IfModule mod_env.c>
|
<IfModule mod_env.c>
|
||||||
# Ensure that X-Forwarded-Host is only allowed to determine the request
|
# Ensure that X-Forwarded-Host is only allowed to determine the request
|
||||||
# hostname for servers ips defined by SS_TRUSTED_PROXY_IPS in your _ss_environment.php
|
# hostname for servers ips defined by SS_TRUSTED_PROXY_IPS in your _ss_environment.php
|
||||||
# Note that in a future release this setting will be always on.
|
# Note that in a future release this setting will be always on.
|
||||||
SetEnv BlockUntrustedProxyHeaders true
|
SetEnv BlockUntrustedIPs true
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user