Skip to content

Commit

Permalink
Use domain path(folder) from the current request (#5871)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Sep 19, 2022
1 parent 5fe0552 commit 7f9d9f2
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions protected/humhub/components/UrlManager.php
Expand Up @@ -60,36 +60,4 @@ public function getHostInfo()

return $data['scheme'] . '://' . $data['host'] . (isset($data['port']) ? ':' . $data['port'] : '');
}

/**
* @inheritdoc
*/
public function getBaseUrl()
{
$baseUrl = Yii::$app->settings->get('baseUrl');

if (empty($baseUrl)) {
return parent::getBaseUrl();
}

$data = parse_url($baseUrl);

return $data['path'] ?? '';
}

/**
* @inheritdoc
*/
public function getScriptUrl()
{
$baseUrl = Yii::$app->settings->get('baseUrl');

if (empty($baseUrl)) {
return parent::getScriptUrl();
}

$data = parse_url($baseUrl);

return ($data['path'] ?? '') . '/' . basename(parent::getScriptUrl());
}
}

0 comments on commit 7f9d9f2

Please sign in to comment.