Project

General

Profile

Bug #23089 ยป 14987.diff

Administrator Admin, 2010-07-03 16:15

View differences:

typo3/cli_dispatch.phpsh (working copy)
$checkEnvVars = array('HTTP_USER_AGENT', 'HTTP_HOST', 'SERVER_NAME', 'REMOTE_ADDR', 'REMOTE_PORT', 'SERVER_PROTOCOL');
foreach ($checkEnvVars as $var) {
if (array_key_exists($var, $_SERVER)) {
echo 'SECURITY CHECK FAILD! This script cannot be used within your browser!' . chr(10);
echo 'SECURITY CHECK FAILED! This script cannot be used within your browser!' . chr(10);
echo 'If you are sure that we run in a shell or cronjob, please unset' . chr(10);
echo 'environment variable ' . $var . ' (usually using \'unset ' . $var . '\')' . chr(10);
echo 'before starting this script.' . chr(10);
......
define(STDOUT, fopen('php://stdout', 'w'));
define(STDERR, fopen('php://stderr', 'w'));
} elseif (php_sapi_name() != 'cli') {
die('Not called from a command line interface (eg. a shell or scheduler).'.chr(10));
die('Not called from a command line interface (e.g. a shell or scheduler).' . chr(10));
}
// Defining circumstances for CLI mode:
......
$temp_PATH_thisScript =
$workingDirectory.'/'.preg_replace('/\.\//','',$temp_PATH_thisScript);
if (!@is_file($temp_PATH_thisScript)) {
die ('Relative path found, but an error occured during resolving of the absolute path: '.$temp_PATH_thisScript.chr(10));
die('Relative path found, but an error occurred while resolving the absolute path: ' . $temp_PATH_thisScript . chr(10));
}
} else {
die ('Relative path found, but resolving absolute path is not supported on this platform.'.chr(10));
    (1-1/1)