Skip to content
Browse files

Avoiding problems with relative paths in shell dispatcher

  • Loading branch information...
1 parent 7715689 commit 8538c0e8eafef5104cac95aa88f49b9394203a3f @lorenzo lorenzo committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Cake/Console/ShellDispatcher.php
View
6 lib/Cake/Console/ShellDispatcher.php
@@ -276,7 +276,11 @@ public function parseParams($args) {
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($params['working']) && (!isset($this->args[0]) || isset($this->args[0]) && $this->args[0][0] !== '.')) {
+ if ($params['working'][0] === '.') {
+ $params['working'] = realpath($params['working']);
+ }
if (empty($this->params['app']) && $params['working'] != $params['root']) {
$params['root'] = dirname($params['working']);
$params['app'] = basename($params['working']);

0 comments on commit 8538c0e

Please sign in to comment.
Something went wrong with that request. Please try again.