mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Check whether run from cli or from web request within cli-script.php (#3984)
* ENHANCEMENT - Improved access determination * ENHANCEMENT - Added an additional check for the existence of the mod_rewrite module
This commit is contained in:
parent
2d119f021d
commit
4240785fc7
@ -13,7 +13,7 @@
|
||||
/**
|
||||
* Ensure that people can't access this from a web-server
|
||||
*/
|
||||
if(isset($_SERVER['HTTP_HOST'])) {
|
||||
if(PHP_SAPI != "cli" && PHP_SAPI != "cgi" && PHP_SAPI != "cgi-fcgi") {
|
||||
echo "cli-script.php can't be run from a web request, you have to run it on the command-line.";
|
||||
die();
|
||||
}
|
||||
|
@ -980,6 +980,8 @@ class InstallRequirements {
|
||||
return true;
|
||||
} elseif(isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE'] == 'On') {
|
||||
return true;
|
||||
} elseif(isset($_SERVER['REDIRECT_HTTP_MOD_REWRITE']) && $_SERVER['REDIRECT_HTTP_MOD_REWRITE'] == 'On') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user