Avoiding problems with relative paths in shell dispatcher

This commit is contained in:
Jose Lorenzo Rodriguez 2012-10-28 12:57:44 +01:00
parent 7715689523
commit 8538c0e8ea

View file

@ -276,7 +276,11 @@ class ShellDispatcher {
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']);