Commit e7de579e by Qiang Xue

Fixes #5202: View::registerJsFiles should not strip leading backlashes for protocol relative URL

parent 97e37f78
...@@ -380,7 +380,7 @@ class View extends \yii\base\View ...@@ -380,7 +380,7 @@ class View extends \yii\base\View
} else { } else {
$this->getAssetManager()->bundles[$key] = new AssetBundle([ $this->getAssetManager()->bundles[$key] = new AssetBundle([
'baseUrl' => '', 'baseUrl' => '',
'css' => [ltrim($url, '/')], 'css' => [strncmp($url, '//', 2) === 0 ? $url : ltrim($url, '/')],
'cssOptions' => $options, 'cssOptions' => $options,
'depends' => (array) $depends, 'depends' => (array) $depends,
]); ]);
...@@ -445,7 +445,7 @@ class View extends \yii\base\View ...@@ -445,7 +445,7 @@ class View extends \yii\base\View
} else { } else {
$this->getAssetManager()->bundles[$key] = new AssetBundle([ $this->getAssetManager()->bundles[$key] = new AssetBundle([
'baseUrl' => '', 'baseUrl' => '',
'js' => [ltrim($url, '/')], 'js' => [strncmp($url, '//', 2) === 0 ? $url : ltrim($url, '/')],
'jsOptions' => $options, 'jsOptions' => $options,
'depends' => (array) $depends, 'depends' => (array) $depends,
]); ]);
......
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