Fix Windows path bugs

This commit is contained in:
Frédéric Guillot
2015-04-22 21:08:03 -04:00
parent b5163c483c
commit 81841c73c2
2 changed files with 5 additions and 1 deletions

View File

@@ -513,10 +513,12 @@ class Helper
*/
public function getCurrentBaseUrl()
{
$self = str_replace('\\', '/', dirname($_SERVER['PHP_SELF']));
$url = Request::isHTTPS() ? 'https://' : 'http://';
$url .= $_SERVER['SERVER_NAME'];
$url .= $_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443 ? '' : ':'.$_SERVER['SERVER_PORT'];
$url .= dirname($_SERVER['PHP_SELF']) !== '/' ? dirname($_SERVER['PHP_SELF']).'/' : '/';
$url .= $self !== '/' ? $self.'/' : '/';
return $url;
}