fixed url helper to not prepend to relative URLs

This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
Carsten Brandt
2014-03-23 21:32:42 +01:00
gitea-unlock(16/)
parent a9e37b906c
commit 94fb8672d1

2
framework/helpers/BaseUrl.php
View File

@@ -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;
} }