From 81841c73c2fd05f3274fa790141aa9b838db9dd3 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 22 Apr 2015 21:08:03 -0400 Subject: Fix Windows path bugs --- app/Core/Helper.php | 4 +++- app/Core/Session.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'app') 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, -- cgit v1.2.3