Skip to content

Commit

Permalink
fixed failing shell dispatcher test
Browse files Browse the repository at this point in the history
  • Loading branch information
bancer committed Nov 8, 2016
1 parent 467ee85 commit 92e3807
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/Cake/Console/ShellDispatcher.php
Expand Up @@ -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);
}

Expand All @@ -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;
}

/**
Expand Down

0 comments on commit 92e3807

Please sign in to comment.