Commit 4f9e4e2c by Carsten Brandt

ensure assetmanager and baseurl to handle relative urls correctly

parent 5f77cb97
......@@ -192,7 +192,7 @@ class BaseUrl
if ($url === '') {
$url = Yii::$app->getRequest()->getUrl();
} elseif ($url[0] !== '/' && $url[0] !== '#' && strpos($url, '://') === false && strncmp($url, './', 2) !== 0) {
} elseif ($url[0] !== '/' && $url[0] !== '#' && $url[0] !== '.' && strpos($url, '://') === false) {
$url = Yii::$app->getRequest()->getBaseUrl() . '/' . $url;
}
......
......@@ -143,14 +143,14 @@ class AssetBundle extends Object
public function registerAssetFiles($view)
{
foreach ($this->js as $js) {
if (strpos($js, '/') !== 0 && strpos($js, '://') === false) {
if ($js[0] !== '/' && $js[0] !== '.' && strpos($js, '://') === false) {
$view->registerJsFile($this->baseUrl . '/' . $js, [], $this->jsOptions);
} else {
$view->registerJsFile($js, [], $this->jsOptions);
}
}
foreach ($this->css as $css) {
if (strpos($css, '/') !== 0 && strpos($css, '://') === false) {
if ($css[0] !== '/' && $css[0] !== '.' && strpos($css, '://') === false) {
$view->registerCssFile($this->baseUrl . '/' . $css, [], $this->cssOptions);
} else {
$view->registerCssFile($css, [], $this->cssOptions);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment