Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [20990] trunk/wp-includes: Update Fire browser detection. Date:Mon, 4 Jun 2012 16:04:54 +0000 (UTC)
 

Revision
20990
Author
ryan
Date
2012-06-04 16:04:54 +0000 (Mon, 04 Jun 2012)

Log Message

Update Fire browser detection. Handle silke mode. Props azaozz, nacin, georgestephanis. fixes #20014

Modified Paths

Diff

Modified: trunk/wp-includes/general-template.php (20989 => 20990)


--- trunk/wp-includes/general-template.php	2012-06-04 15:58:26 UTC (rev 20989)
+++ trunk/wp-includes/general-template.php	2012-06-04 16:04:54 UTC (rev 20990)
@@ -1753,10 +1753,7 @@
 
 		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;
 			}

Modified: trunk/wp-includes/vars.php (20989 => 20990)


--- trunk/wp-includes/vars.php	2012-06-04 15:58:26 UTC (rev 20989)
+++ trunk/wp-includes/vars.php	2012-06-04 16:04:54 UTC (rev 20990)
@@ -113,6 +113,8 @@
 		$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;