Permalink
Browse files

MDL-22260 Added server-side detection of iPhone/iPad and don't serve …

…TinyMCE at all
  • Loading branch information...
1 parent 8093188 commit c55ff1834d2ece8fa3a83dba5111023aa958d914 @moodler moodler committed Jun 23, 2010
Showing with 17 additions and 6 deletions.
  1. +3 −1 lib/editor/tinymce/lib.php
  2. +14 −5 lib/moodlelib.php
@@ -30,13 +30,15 @@ public function supported_by_browser() {
return true;
} else if (check_browser_version('Gecko', 20030516)) {
return true;
+ } else if (check_browser_version('Safari iOS')) {
+ return false;
} else if (check_browser_version('Safari', 3)) {
return true;
} else if (check_browser_version('Opera', 9)) {
return true;
}
- return true;
+ return false;
}
public function get_supported_formats() {
View
@@ -7264,12 +7264,12 @@ function check_browser_version($brand='MSIE', $version=5.5) {
case 'Camino': /// Mozilla Firefox browsers
- if (preg_match("/Camino\/([0-9\.]+)/i", $agent, $match)) {
- if (version_compare($match[1], $version) >= 0) {
- return true;
- }
+ if (preg_match("/Camino\/([0-9\.]+)/i", $agent, $match)) {
+ if (version_compare($match[1], $version) >= 0) {
+ return true;
}
- break;
+ }
+ break;
case 'Firefox': /// Mozilla Firefox browsers
@@ -7344,6 +7344,15 @@ function check_browser_version($brand='MSIE', $version=5.5) {
break;
+ case 'Safari iOS': /// Safari on iPhone and iPad
+ if (strpos($agent, 'iPhone')) {
+ return true;
+ }
+ if (strpos($agent, 'iPad')) {
+ return true;
+ }
+ break;
+
}
return false;

0 comments on commit c55ff18

Please sign in to comment.