Skip to content

Commit

Permalink
Use KANBOARD_URL to build URIs if specified
Browse files Browse the repository at this point in the history
  • Loading branch information
freespace authored Feb 5, 2020
1 parent 54dd3bd commit 0a6f614
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/Helper/UrlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,13 @@ public function base()
public function dir()
{
if ($this->directory === '' && $this->request->getMethod() !== '') {
$this->directory = str_replace('\\', '/', dirname($this->request->getServerVariable('PHP_SELF')));
$this->directory = $this->directory !== '/' ? $this->directory.'/' : '/';
$this->directory = str_replace('//', '/', $this->directory);
if (defined('KANBOARD_URL') && strlen(KANBOARD_URL) > 0) {
$this->directory = parse_url(KANBOARD_URL, PHP_URL_PATH);
} else {
$this->directory = str_replace('\\', '/', dirname($this->request->getServerVariable('PHP_SELF')));
$this->directory = $this->directory !== '/' ? $this->directory.'/' : '/';
$this->directory = str_replace('//', '/', $this->directory);
}
}

return $this->directory;
Expand Down

0 comments on commit 0a6f614

Please sign in to comment.