bug #61 replaced php_sapi_name() with PHP_SAPI (fabpot)

This PR was merged into the master branch.

Discussion
----------

replaced php_sapi_name() with PHP_SAPI

Commits
-------

df6b8a0 replaced php_sapi_name() with PHP_SAPI
This commit is contained in:
Fabien Potencier
2017-05-10 16:16:29 -07:00
+1 -1
View File
@@ -22,7 +22,7 @@ if (getenv('APP_DEBUG')) {
// Feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || PHP_SAPI === 'cli-server')
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');