mirror of
https://github.com/symfony/recipes.git
synced 2026-09-12 07:36:30 +03:00
Better fix
This commit is contained in:
@@ -19,15 +19,15 @@ $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';
|
||||
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));
|
||||
|
||||
if ($debug) {
|
||||
// Compatibility with the built-in PHP web server
|
||||
if ('/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__.$_SERVER['SCRIPT_NAME'])) {
|
||||
return false;
|
||||
}
|
||||
umask(0000);
|
||||
|
||||
Debug::enable();
|
||||
}
|
||||
|
||||
if (PHP_SAPI === 'cli-server' && '/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__. $_SERVER['SCRIPT_NAME'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
|
||||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
||||
}
|
||||
|
||||
@@ -19,15 +19,15 @@ $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';
|
||||
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));
|
||||
|
||||
if ($debug) {
|
||||
// Compatibility with the built-in PHP web server
|
||||
if ('/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__.$_SERVER['SCRIPT_NAME'])) {
|
||||
return false;
|
||||
}
|
||||
umask(0000);
|
||||
|
||||
Debug::enable();
|
||||
}
|
||||
|
||||
if (PHP_SAPI === 'cli-server' && '/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__. $_SERVER['SCRIPT_NAME'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
|
||||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user