From 8dfe243dd4a20b7431406b7007f168954f0999dc Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 4 Jun 2012 16:04:54 +0000 Subject: [PATCH] Update Fire browser detection. Handle silke mode. Props azaozz, nacin, georgestephanis. fixes #20014 git-svn-id: http://core.svn.wordpress.org/trunk@20990 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 5 +---- wp-includes/vars.php | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index bf0f7807da22..19726961e7b6 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1753,10 +1753,7 @@ 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 ) { - if ( wp_is_mobile() || false !== strpos( $_SERVER['HTTP_USER_AGENT'], '; Silk/' ) ) - $wp_rich_edit = ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 ); - else - $wp_rich_edit = true; + $wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 ); } elseif ( $is_gecko || $is_opera || $is_chrome || $is_IE ) { $wp_rich_edit = true; } diff --git a/wp-includes/vars.php b/wp-includes/vars.php index 0138dbc1883d..7585793df7ea 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -113,6 +113,8 @@ function wp_is_mobile() { $is_mobile = false; } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false // many mobile devices (all iPhone, iPad, etc.) || strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false + || 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 ) { $is_mobile = true;