Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…TinyMCE at all
  • Loading branch information...
commit c55ff1834d2ece8fa3a83dba5111023aa958d914 1 parent 8093188
@moodler moodler authored
Showing with 17 additions and 6 deletions.
  1. +3 −1 lib/editor/tinymce/lib.php
  2. +14 −5 lib/moodlelib.php
View
4 lib/editor/tinymce/lib.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
19 lib/moodlelib.php
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.