replaced php_sapi_name() with PHP_SAPI

This commit is contained in:
Fabien Potencier
2017-05-10 11:19:42 -07:00
parent a9f9fc63fb
commit df6b8a04b8
+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.');