]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13623 proper version detection; merged from MOODLE_19_STABLE
authorskodak <skodak>
Tue, 26 Feb 2008 18:35:30 +0000 (18:35 +0000)
committerskodak <skodak>
Tue, 26 Feb 2008 18:35:30 +0000 (18:35 +0000)
lib/moodlelib.php
lib/setup.php

index d78d3de4bfc348a42f7e5b485c085dc079b924a2..ab0cd992cb50708e9fd7a5eebe8e14e6236c554c 100644 (file)
@@ -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);
index 0923afb4576fcd0f6a311d97103e6919fe62c86c..51fbec85a35c0c5acb182881e0e88ff7b3342b16 100644 (file)
@@ -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);