From 92e380737df96d654855289953dc13082d6f9b3f Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Tue, 8 Nov 2016 10:44:08 +0100 Subject: [PATCH] fixed failing shell dispatcher test --- lib/Cake/Console/ShellDispatcher.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index fe0dd4274..34b98c2db 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -322,7 +322,7 @@ class ShellDispatcher { $params['working'] .= '/' . $params['app']; } - if (DS == '\\' || !empty($isWin)) { + if ($this->_isWindowsPath($params['app']) || !empty($isWin)) { $params = str_replace('/', '\\', $params); } @@ -336,7 +336,17 @@ class ShellDispatcher { * @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; } /**