Skip to content

Commit

Permalink
Path resolving fix when 0 is provided (laravel#40650)
Browse files Browse the repository at this point in the history
  • Loading branch information
4m1n0s authored Jan 26, 2022
1 parent f2bfbed commit 9667047
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public function path($path = '')
{
$appPath = $this->appPath ?: $this->basePath.DIRECTORY_SEPARATOR.'app';

return $appPath.($path ? DIRECTORY_SEPARATOR.$path : $path);
return $appPath.($path != '' ? DIRECTORY_SEPARATOR.$path : '');
}

/**
Expand All @@ -365,7 +365,7 @@ public function useAppPath($path)
*/
public function basePath($path = '')
{
return $this->basePath.($path ? DIRECTORY_SEPARATOR.$path : $path);
return $this->basePath.($path != '' ? DIRECTORY_SEPARATOR.$path : '');
}

/**
Expand All @@ -376,7 +376,7 @@ public function basePath($path = '')
*/
public function bootstrapPath($path = '')
{
return $this->basePath.DIRECTORY_SEPARATOR.'bootstrap'.($path ? DIRECTORY_SEPARATOR.$path : $path);
return $this->basePath.DIRECTORY_SEPARATOR.'bootstrap'.($path != '' ? DIRECTORY_SEPARATOR.$path : '');
}

/**
Expand All @@ -387,7 +387,7 @@ public function bootstrapPath($path = '')
*/
public function configPath($path = '')
{
return $this->basePath.DIRECTORY_SEPARATOR.'config'.($path ? DIRECTORY_SEPARATOR.$path : $path);
return $this->basePath.DIRECTORY_SEPARATOR.'config'.($path != '' ? DIRECTORY_SEPARATOR.$path : '');
}

/**
Expand All @@ -398,7 +398,7 @@ public function configPath($path = '')
*/
public function databasePath($path = '')
{
return ($this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database').($path ? DIRECTORY_SEPARATOR.$path : $path);
return ($this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database').($path != '' ? DIRECTORY_SEPARATOR.$path : '');
}

/**
Expand All @@ -424,7 +424,7 @@ public function useDatabasePath($path)
*/
public function langPath($path = '')
{
return $this->langPath.($path ? DIRECTORY_SEPARATOR.$path : '');
return $this->langPath.($path != '' ? DIRECTORY_SEPARATOR.$path : '');
}

/**
Expand Down Expand Up @@ -487,7 +487,7 @@ public function useStoragePath($path)
*/
public function resourcePath($path = '')
{
return $this->basePath.DIRECTORY_SEPARATOR.'resources'.($path ? DIRECTORY_SEPARATOR.$path : $path);
return $this->basePath.DIRECTORY_SEPARATOR.'resources'.($path != '' ? DIRECTORY_SEPARATOR.$path : '');
}

/**
Expand All @@ -502,7 +502,7 @@ public function viewPath($path = '')
{
$basePath = $this['config']->get('view.paths')[0];

return rtrim($basePath, DIRECTORY_SEPARATOR).($path ? DIRECTORY_SEPARATOR.$path : $path);
return rtrim($basePath, DIRECTORY_SEPARATOR).($path != '' ? DIRECTORY_SEPARATOR.$path : '');
}

/**
Expand Down

0 comments on commit 9667047

Please sign in to comment.