change cli detection to use php_sapi_name()

This commit is contained in:
Ralf Becker
2013-09-10 17:29:58 +00:00
parent 8105242434
commit 892500fee3
9 changed files with 10 additions and 10 deletions

View File

@@ -13,7 +13,7 @@
chdir(dirname(__FILE__)); // to enable our relative pathes to work
if (isset($_SERVER['HTTP_HOST'])) // security precaution: forbit calling admin-cli as web-page
if (php_sapi_name() !== 'cli') // security precaution: forbit calling admin-cli as web-page
{
die('<h1>admin-cli.php must NOT be called as web-page --> exiting !!!</h1>');
}