From 40cb5b813eb5fff34d0fc4b20b616f777162774a Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Fri, 18 Oct 2013 13:21:30 -0400 Subject: [PATCH] Fixed bug in AssetBundle::registerAssets(). --- framework/yii/web/AssetBundle.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/framework/yii/web/AssetBundle.php b/framework/yii/web/AssetBundle.php index 6bd7bff..3afc699 100644 --- a/framework/yii/web/AssetBundle.php +++ b/framework/yii/web/AssetBundle.php @@ -139,17 +139,17 @@ class AssetBundle extends Object public function registerAssets($view) { foreach ($this->js as $js) { - if ($js[0] === '/') { - $view->registerJsFile($this->baseUrl . $js, $this->jsOptions); - } else { + if (strpos($js, '/') !== 0 && strpos($js, '://') === false) { $view->registerJsFile($this->baseUrl . '/' . $js, $this->jsOptions); + } else { + $view->registerJsFile($js, $this->jsOptions); } } foreach ($this->css as $css) { - if ($css[0] === '/') { - $view->registerCssFile($this->baseUrl . $css, $this->cssOptions); - } else { + if (strpos($css, '/') !== 0 && strpos($css, '://') === false) { $view->registerCssFile($this->baseUrl . '/' . $css, $this->cssOptions); + } else { + $view->registerCssFile($css, $this->cssOptions); } } }