From e1b3703c204b88896d5b4823a0ef8f10a899a18a Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Mon, 21 Feb 2011 15:45:46 -0300 Subject: [PATCH] Adding a protection to cake console be executed in driver root (windows). Fixes #1408. --- app/console/cake.bat | 2 +- cake/console/cake.bat | 2 +- cake/console/shell_dispatcher.php | 3 +++ cake/console/templates/skel/console/cake.bat | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/console/cake.bat b/app/console/cake.bat index ed04546c9ef..7d0c1247db1 100644 --- a/app/console/cake.bat +++ b/app/console/cake.bat @@ -25,7 +25,7 @@ SET app=%0 SET lib=%~dp0 -php -q "%lib%cake.php" -working "%CD%" %* +php -q "%lib%cake.php" -working "%CD% " %* echo. diff --git a/cake/console/cake.bat b/cake/console/cake.bat index 40a27142559..a22cfcacdfe 100644 --- a/cake/console/cake.bat +++ b/cake/console/cake.bat @@ -25,7 +25,7 @@ SET app=%0 SET lib=%~dp0 -php -q "%lib%cake.php" -working "%CD%" %* +php -q "%lib%cake.php" -working "%CD% " %* echo. diff --git a/cake/console/shell_dispatcher.php b/cake/console/shell_dispatcher.php index 1b520500b23..0a625f8cdbf 100644 --- a/cake/console/shell_dispatcher.php +++ b/cake/console/shell_dispatcher.php @@ -244,6 +244,9 @@ public function parseParams($args) { } $params = str_replace('\\', '/', $params); + if (isset($params['working'])) { + $params['working'] = trim($params['working']); + } if (!empty($params['working']) && (!isset($this->args[0]) || isset($this->args[0]) && $this->args[0]{0} !== '.')) { if (empty($this->params['app']) && $params['working'] != $params['root']) { $params['root'] = dirname($params['working']); diff --git a/cake/console/templates/skel/console/cake.bat b/cake/console/templates/skel/console/cake.bat index ed04546c9ef..7d0c1247db1 100644 --- a/cake/console/templates/skel/console/cake.bat +++ b/cake/console/templates/skel/console/cake.bat @@ -25,7 +25,7 @@ SET app=%0 SET lib=%~dp0 -php -q "%lib%cake.php" -working "%CD%" %* +php -q "%lib%cake.php" -working "%CD% " %* echo.