TinyMCE: better exclusion of Opera mobile, fixes #21416

git-svn-id: http://core.svn.wordpress.org/trunk@21367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2012-07-30 19:40:52 +00:00
parent 7c9d817511
commit d77372ea76
2 changed files with 3 additions and 5 deletions

View File

@ -1754,10 +1754,7 @@ function user_can_richedit() {
if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users
if ( $is_safari ) { if ( $is_safari ) {
$wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 ); $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; $wp_rich_edit = true;
} }
} }

View File

@ -116,7 +116,8 @@ function wp_is_mobile() {
|| strpos($_SERVER['HTTP_USER_AGENT'], 'Silk/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Silk/') !== false
|| strpos($_SERVER['HTTP_USER_AGENT'], 'Kindle') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Kindle') !== false
|| strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== 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; $is_mobile = true;
} else { } else {
$is_mobile = false; $is_mobile = false;