octicon-rss(16/)
You've already forked yii2
mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 02:13:17 +08:00
fixed url helper to not prepend to relative URLs
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
octicon-diff(16/tw-mr-1) 1 changed files with 1 additions and 1 deletions
@@ -193,7 +193,7 @@ class BaseUrl
|
|||||||
|
|
||||||
if ($url === '') {
|
if ($url === '') {
|
||||||
$url = Yii::$app->getRequest()->getUrl();
|
$url = Yii::$app->getRequest()->getUrl();
|
||||||
} elseif ($url[0] !== '/' && $url[0] !== '#' && strpos($url, '://') === false) {
|
} elseif ($url[0] !== '/' && $url[0] !== '#' && strpos($url, '://') === false && strncmp($url, './', 2) !== 0) {
|
||||||
$url = Yii::$app->getRequest()->getBaseUrl() . '/' . $url;
|
$url = Yii::$app->getRequest()->getBaseUrl() . '/' . $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user