[BUGFIX] cli dispatcher throws notice on windows systems 72/19772/2
authorNicole Cordes <typo3@cordes.co>
Tue, 9 Apr 2013 21:12:31 +0000 (23:12 +0200)
committerErnesto Baschny <ernst@cron-it.de>
Tue, 9 Apr 2013 21:31:59 +0000 (23:31 +0200)
In the CLI interface (cli_dispatch.phpsh) the server variable
$_SERVER['PWD'] is used which doesn't exists on windows
systems. PHP throws a notice, because the script doesn't check the
existence of the variable.

Change-Id: I425c48a7bd5a4e6fa9c86cc6e4dcae58493fd625
Fixes: #20392
Releases: 4.7, 4.5
Reviewed-on: https://review.typo3.org/19772
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
typo3/cli_dispatch.phpsh

index f3d1b00..9a79666 100755 (executable)
@@ -90,7 +90,7 @@ if (stristr(PHP_OS,'win') && !stristr(PHP_OS,'darwin')) {
 
        // Resolve path
 if ($relativePath) {
-       $workingDirectory = $_SERVER['PWD'] ? $_SERVER['PWD'] : getcwd();
+       $workingDirectory = isset($_SERVER['PWD']) ? $_SERVER['PWD'] : getcwd();
        if ($workingDirectory) {
                $temp_PATH_thisScript =
                        $workingDirectory.'/'.preg_replace('/\.\//','',$temp_PATH_thisScript);