From e7de579ee6963a0671a4f50ab7b20c821d2faad5 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Fri, 26 Sep 2014 16:35:15 -0400 Subject: [PATCH] Fixes #5202: View::registerJsFiles should not strip leading backlashes for protocol relative URL --- framework/web/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/web/View.php b/framework/web/View.php index 773306829f..95acf42025 100644 --- a/framework/web/View.php +++ b/framework/web/View.php @@ -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, ]);