Skip to content

Commit 2047326

Browse files
committed
Better fix
1 parent 1a21559 commit 2047326

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

symfony/framework-bundle/3.3/public/index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));
2020

2121
if ($debug) {
22-
// Compatibility with the built-in PHP web server
23-
if ('/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__.$_SERVER['SCRIPT_NAME'])) {
24-
return false;
25-
}
2622
umask(0000);
2723

2824
Debug::enable();
2925
}
3026

27+
if (PHP_SAPI === 'cli-server' && '/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__. $_SERVER['SCRIPT_NAME'])) {
28+
return false;
29+
}
30+
3131
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
3232
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
3333
}

symfony/framework-bundle/4.2/public/index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));
2020

2121
if ($debug) {
22-
// Compatibility with the built-in PHP web server
23-
if ('/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__.$_SERVER['SCRIPT_NAME'])) {
24-
return false;
25-
}
2622
umask(0000);
2723

2824
Debug::enable();
2925
}
3026

27+
if (PHP_SAPI === 'cli-server' && '/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__. $_SERVER['SCRIPT_NAME'])) {
28+
return false;
29+
}
30+
3131
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
3232
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
3333
}

0 commit comments

Comments
 (0)