From 4756795bf7bdd8b66436cc8026b4b0dafa55fe95 Mon Sep 17 00:00:00 2001 From: Rossiani Wijaya Date: Thu, 28 Oct 2010 07:13:56 +0000 Subject: [PATCH] MDL-22528: fixed AJAX Course editing in Chrome and Safari. --- course/format/topics/ajax.php | 4 +--- course/format/weeks/ajax.php | 4 +--- lib/moodlelib.php | 8 ++++++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/course/format/topics/ajax.php b/course/format/topics/ajax.php index 0dbea4e1223..af7a5278e1c 100644 --- a/course/format/topics/ajax.php +++ b/course/format/topics/ajax.php @@ -5,6 +5,4 @@ $CFG->ajaxcapable = true; -$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111); - - +$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari'=>531, 'Chrome'=>6.0); diff --git a/course/format/weeks/ajax.php b/course/format/weeks/ajax.php index 0dbea4e1223..af7a5278e1c 100644 --- a/course/format/weeks/ajax.php +++ b/course/format/weeks/ajax.php @@ -5,6 +5,4 @@ $CFG->ajaxcapable = true; -$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111); - - +$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari'=>531, 'Chrome'=>6.0); diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 30252a4f158..efe3ba89cdc 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -7565,6 +7565,14 @@ function check_php_version($version='5.2.4') { break; + case 'Chrome': + if (preg_match("/Chrome\/(.*)[ ]+/i", $agent, $match)) { + if (version_compare($match[1], $version) >= 0) { + return true; + } + } + break; + case 'Safari iOS': /// Safari on iPhone and iPad if (strpos($agent, 'iPhone')) { return true;