diff --git a/core/util.inc.php b/core/util.inc.php index a6af136a..d216e559 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -1040,6 +1040,15 @@ function _sanitise_environment() { $_POST = _stripslashes_r($_POST); $_COOKIE = _stripslashes_r($_COOKIE); } + + if(php_sapi_name() === "cli") { + global $argc, $argv; + $_SERVER['REMOTE_ADDR'] = "0.0.0.0"; + $_SERVER['HTTP_HOST'] = ""; + if($argc > 1) { + $_GET['q'] = $argv[1]; + } + } } function _get_themelet_files($_theme) {