From: skodak Date: Tue, 26 Feb 2008 18:35:30 +0000 (+0000) Subject: MDL-13623 proper version detection; merged from MOODLE_19_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8cadac9dc7b3b8528015b1eda243bb03d4e1d331;p=moodle.git MDL-13623 proper version detection; merged from MOODLE_19_STABLE --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index d78d3de4bf..ab0cd992cb 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2057,8 +2057,7 @@ function require_logout() { error_log('MoodleSessionTest cookie could not be set in moodlelib.php:'.__LINE__); error_log('Headers were already sent in file: '.$file.' on line '.$line); } else { - if (function_exists('array_fill_keys')) { - //PHP 5.2.0 + if (check_php_version('5.2.0')) { setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly); } else { setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure); @@ -7756,7 +7755,7 @@ function report_session_error() { moodle_setlocale(); //clear session cookies - if (function_exists('array_fill_keys')) { + if (check_php_version('5.2.0')) { //PHP 5.2.0 setcookie('MoodleSession'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly); setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly); diff --git a/lib/setup.php b/lib/setup.php index 0923afb457..51fbec85a3 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -517,8 +517,7 @@ global $HTTPSPAGEREQUIRED; if (empty($nomoodlecookie)) { session_name('MoodleSession'.$CFG->sessioncookie); - if (function_exists('array_fill_keys')) { - //PHP 5.2.0 + if (check_php_version('5.2.0')) { session_set_cookie_params(0, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly); } else { session_set_cookie_params(0, $CFG->sessioncookiepath, '', $CFG->cookiesecure); @@ -530,8 +529,7 @@ global $HTTPSPAGEREQUIRED; if (!empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) { $_SESSION['SESSION']->has_timed_out = true; } - if (function_exists('array_fill_keys')) { - //PHP 5.2.0 + if (check_php_version('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);