diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index fe0dd42748b..34b98c2db4e 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -322,7 +322,7 @@ public function parseParams($args) { $params['working'] .= '/' . $params['app']; } - if (DS == '\\' || !empty($isWin)) { + if ($this->_isWindowsPath($params['app']) || !empty($isWin)) { $params = str_replace('/', '\\', $params); } @@ -336,7 +336,17 @@ public function parseParams($args) { * @return boolean */ protected function _isAbsolutePath($path) { - return $path[0] === '/' || preg_match('/([a-z])(:)/i', $path); + return $path[0] === '/' || $this->_isWindowsPath($path); + } + +/** + * Checks whether the given path is Window OS path. + * + * @param string $path absolute path. + * @return boolean + */ + protected function _isWindowsPath($path) { + return preg_match('/([a-z])(:)/i', $path) == 1; } /**