diff options
author | Frédéric Guillot <fred@kanboard.net> | 2015-04-22 21:08:03 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2015-04-22 21:08:03 -0400 |
commit | 81841c73c2fd05f3274fa790141aa9b838db9dd3 (patch) | |
tree | 4a55951c58f48a87dc1533acae1e5e151622436b | |
parent | b5163c483c88914ac17e94e275871996f12fc210 (diff) |
Fix Windows path bugs
-rw-r--r-- | app/Core/Helper.php | 4 | ||||
-rw-r--r-- | app/Core/Session.php | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/Core/Helper.php b/app/Core/Helper.php index 76f90755..7f6b2fd1 100644 --- a/app/Core/Helper.php +++ b/app/Core/Helper.php @@ -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; } diff --git a/app/Core/Session.php b/app/Core/Session.php index 0e5f7426..c35014cd 100644 --- a/app/Core/Session.php +++ b/app/Core/Session.php @@ -41,6 +41,8 @@ class Session implements ArrayAccess */ public function open($base_path = '/') { + $base_path = str_replace('\\', '/', $base_path); + // HttpOnly and secure flags for session cookie session_set_cookie_params( self::SESSION_LIFETIME, |