From da057a8eb0ec318e2f52a7179fc840aad1a34549 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 30 Jul 2012 19:40:52 +0000 Subject: [PATCH] TinyMCE: better exclusion of Opera mobile, fixes #21416 git-svn-id: https://develop.svn.wordpress.org/trunk@21367 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/general-template.php | 5 +---- wp-includes/vars.php | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index a8ef8e289c..32302f175a 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1754,11 +1754,8 @@ function user_can_richedit() { if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users if ( $is_safari ) { $wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 ); - } elseif ( $is_gecko || $is_chrome || $is_IE ) { + } elseif ( $is_gecko || $is_chrome || $is_IE || ( $is_opera && !wp_is_mobile() ) ) { $wp_rich_edit = true; - } elseif ( $is_opera ) { - if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mobi/') === false && strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini/') === false ) - $wp_rich_edit = true; } } } diff --git a/wp-includes/vars.php b/wp-includes/vars.php index 7585793df7..23e0e5804f 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -116,7 +116,8 @@ function wp_is_mobile() { || strpos($_SERVER['HTTP_USER_AGENT'], 'Silk/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Kindle') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== false - || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false ) { + || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false + || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mobi') !== false ) { $is_mobile = true; } else { $is_mobile = false;