Fix Windows path bugs
This commit is contained in:
@@ -513,10 +513,12 @@ class Helper
|
|||||||
*/
|
*/
|
||||||
public function getCurrentBaseUrl()
|
public function getCurrentBaseUrl()
|
||||||
{
|
{
|
||||||
|
$self = str_replace('\\', '/', dirname($_SERVER['PHP_SELF']));
|
||||||
|
|
||||||
$url = Request::isHTTPS() ? 'https://' : 'http://';
|
$url = Request::isHTTPS() ? 'https://' : 'http://';
|
||||||
$url .= $_SERVER['SERVER_NAME'];
|
$url .= $_SERVER['SERVER_NAME'];
|
||||||
$url .= $_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443 ? '' : ':'.$_SERVER['SERVER_PORT'];
|
$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;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ class Session implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function open($base_path = '/')
|
public function open($base_path = '/')
|
||||||
{
|
{
|
||||||
|
$base_path = str_replace('\\', '/', $base_path);
|
||||||
|
|
||||||
// HttpOnly and secure flags for session cookie
|
// HttpOnly and secure flags for session cookie
|
||||||
session_set_cookie_params(
|
session_set_cookie_params(
|
||||||
self::SESSION_LIFETIME,
|
self::SESSION_LIFETIME,
|
||||||
|
|||||||
Reference in New Issue
Block a user