From 153e51df94c93d8d4d925c9c2a8b5967489225b9 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Thu, 23 May 2013 23:34:12 +0400 Subject: [PATCH] Html::url() fix for anchors --- framework/yii/helpers/base/Html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/helpers/base/Html.php b/framework/yii/helpers/base/Html.php index f601772..90396ec 100644 --- a/framework/yii/helpers/base/Html.php +++ b/framework/yii/helpers/base/Html.php @@ -1364,7 +1364,7 @@ class Html return Yii::$app->getRequest()->getUrl(); } else { $url = Yii::getAlias($url); - if ($url[0] === '/' || strpos($url, '://')) { + if ($url[0] === '/' || $url[0] === '#' || strpos($url, '://')) { return $url; } else { return Yii::$app->getRequest()->getBaseUrl() . '/' . $url;