MDL-13623 fixed regression in PHP < 5.2.0
This commit is contained in:
+12
-2
@@ -517,7 +517,12 @@ global $HTTPSPAGEREQUIRED;
|
||||
|
||||
if (empty($nomoodlecookie)) {
|
||||
session_name('MoodleSession'.$CFG->sessioncookie);
|
||||
session_set_cookie_params(0, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
|
||||
if (function_exists('array_fill_keys')) {
|
||||
//PHP 5.2.0
|
||||
session_set_cookie_params(0, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
|
||||
} else {
|
||||
session_set_cookie_params(0, $CFG->sessioncookiepath, '', $CFG->cookiesecure);
|
||||
}
|
||||
@session_start();
|
||||
if (! isset($_SESSION['SESSION'])) {
|
||||
$_SESSION['SESSION'] = new object;
|
||||
@@ -525,7 +530,12 @@ global $HTTPSPAGEREQUIRED;
|
||||
if (!empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) {
|
||||
$_SESSION['SESSION']->has_timed_out = true;
|
||||
}
|
||||
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
|
||||
if (function_exists('array_fill_keys')) {
|
||||
//PHP 5.2.0
|
||||
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
|
||||
} else {
|
||||
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, $CFG->sessioncookiepath, '', $CFG->cookiesecure);
|
||||
}
|
||||
$_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] = $_SESSION['SESSION']->session_test;
|
||||
}
|
||||
if (! isset($_SESSION['USER'])) {
|
||||
|
||||
Reference in New Issue
Block a user