mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-34446 Fix bugs in previous commit
This commit is contained in:
parent
1b2bd9768d
commit
007bf47f10
1 changed files with 11 additions and 4 deletions
|
@ -8394,7 +8394,14 @@ function check_php_version($version='5.2.4') {
|
|||
if (empty($version)) {
|
||||
return true; // no version specified
|
||||
}
|
||||
if (preg_match("/Opera\/([0-9\.]+)/i", $agent, $match)) {
|
||||
// Recent Opera useragents have Version/ with the actual version, e.g.:
|
||||
// Opera/9.80 (Windows NT 6.1; WOW64; U; en) Presto/2.10.289 Version/12.01
|
||||
// That's Opera 12.01, not 9.8.
|
||||
if (preg_match("/Version\/([0-9\.]+)/i", $agent, $match)) {
|
||||
if (version_compare($match[1], $version) >= 0) {
|
||||
return true;
|
||||
}
|
||||
} else if (preg_match("/Opera\/([0-9\.]+)/i", $agent, $match)) {
|
||||
if (version_compare($match[1], $version) >= 0) {
|
||||
return true;
|
||||
}
|
||||
|
@ -8409,7 +8416,7 @@ function check_php_version($version='5.2.4') {
|
|||
if (empty($version)) {
|
||||
return true; // no version specified
|
||||
}
|
||||
if (preg_match("/AppleWebKit\/([0-9]+)/i", $agent, $match)) {
|
||||
if (preg_match("/AppleWebKit\/([0-9.]+)/i", $agent, $match)) {
|
||||
if (version_compare($match[1], $version) >= 0) {
|
||||
return true;
|
||||
}
|
||||
|
@ -8445,7 +8452,7 @@ function check_php_version($version='5.2.4') {
|
|||
if (empty($version)) {
|
||||
return true; // no version specified
|
||||
}
|
||||
if (preg_match("/AppleWebKit\/([0-9]+)/i", $agent, $match)) {
|
||||
if (preg_match("/AppleWebKit\/([0-9.]+)/i", $agent, $match)) {
|
||||
if (version_compare($match[1], $version) >= 0) {
|
||||
return true;
|
||||
}
|
||||
|
@ -8695,7 +8702,7 @@ function get_browser_version_classes() {
|
|||
function can_use_rotated_text() {
|
||||
global $USER;
|
||||
return (check_browser_version('MSIE', 9) || check_browser_version('Firefox', 2) ||
|
||||
check_browser_version('Chrome', 21) || check_browser_version('Safari', 536.26) ||
|
||||
check_browser_version('Chrome', 21) || check_browser_version('Safari', 536.25) ||
|
||||
check_browser_version('Opera', 12) || check_browser_version('Safari iOS', 533)) &&
|
||||
!$USER->screenreader;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue