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