From c67544eadb3a6971d958a458457d829d211b1afb Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 17 Feb 2012 00:21:00 +0000 Subject: [PATCH] Don't try to load the visual editor for Amazon's Silk browser (Kindle Fire), as it doesn't work. Add in a sunrise clause for WebKit build 534. see #20012. git-svn-id: http://svn.automattic.com/wordpress/trunk@19936 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 64356c069..e86963e6e 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1751,9 +1751,11 @@ function user_can_richedit() { if ( !isset($wp_rich_edit) ) { $wp_rich_edit = false; - 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_iphone || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 534 ) ) + if ( $is_iphone || 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; } elseif ( $is_gecko || $is_opera || $is_chrome || $is_IE ) { $wp_rich_edit = true;