Skip to content

Commit

Permalink
Update Fire browser detection. Handle silke mode. Props azaozz, nacin…
Browse files Browse the repository at this point in the history
…, georgestephanis. fixes #20014

git-svn-id: http://core.svn.wordpress.org/trunk@20990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
ryan committed Jun 4, 2012
1 parent d35556e commit 8dfe243
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 1 addition & 4 deletions wp-includes/general-template.php
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions wp-includes/vars.php
Expand Up @@ -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;
Expand Down

0 comments on commit 8dfe243

Please sign in to comment.