Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit 4d85bfa

Browse files
committed
minor #1072 Use PHP_SAPI instead of php_sapi_name() (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Use PHP_SAPI instead of php_sapi_name() In Symfony code we only use PHP_SAPI and https://secure.php.net/manual/en/function.php-sapi-name.php says: > Note: > The PHP constant PHP_SAPI has the same value as php_sapi_name(). Commits ------- bdcf438 Use PHP_SAPI instead of php_sapi_name()
2 parents f694e31 + bdcf438 commit 4d85bfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web/app_dev.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Feel free to remove this, extend it, or make something more sophisticated.
1313
if (isset($_SERVER['HTTP_CLIENT_IP'])
1414
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
15-
|| !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')) || php_sapi_name() === 'cli-server')
15+
|| !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')) || PHP_SAPI === 'cli-server')
1616
) {
1717
header('HTTP/1.0 403 Forbidden');
1818
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');

0 commit comments

Comments
 (0)