mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Avoiding problems with relative paths in shell dispatcher
This commit is contained in:
parent
7715689523
commit
8538c0e8ea
1 changed files with 5 additions and 1 deletions
|
@ -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']);
|
||||
|
|
Loading…
Add table
Reference in a new issue