fix/add SAPI checks to prevent execution via webserver
This commit is contained in:
@@ -19,10 +19,7 @@
|
|||||||
$baseLanguage = 'english.lng.php';
|
$baseLanguage = 'english.lng.php';
|
||||||
|
|
||||||
// Check if we're in the CLI
|
// Check if we're in the CLI
|
||||||
if(@php_sapi_name() != 'cli'
|
if(@php_sapi_name() !== 'cli') {
|
||||||
&& @php_sapi_name() != 'cgi'
|
|
||||||
&& @php_sapi_name() != 'cgi-fcgi'
|
|
||||||
) {
|
|
||||||
die('This script will only work in the shell.');
|
die('This script will only work in the shell.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Check if we're in the CLI
|
||||||
|
if(@php_sapi_name() !== 'cli') {
|
||||||
|
die('This script will only work in the shell.');
|
||||||
|
}
|
||||||
|
|
||||||
// give control to command line handler
|
// give control to command line handler
|
||||||
try {
|
try {
|
||||||
CmdLineHandler::processParameters($argc, $argv);
|
CmdLineHandler::processParameters($argc, $argv);
|
||||||
|
|||||||
Reference in New Issue
Block a user