From 45e3751dc93ce7ae3eaa323859c94252b075b873 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 13 Oct 2011 06:37:24 +0000 Subject: [PATCH] Update user_can_richedit to allow TinyMCE in iOS5, props markoheijnen, fixes #18626 git-svn-id: https://develop.svn.wordpress.org/trunk@18963 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/general-template.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index d1f9308d3d..0d9821c225 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1713,17 +1713,18 @@ function rich_edit_exists() { * @return bool */ function user_can_richedit() { - global $wp_rich_edit, $pagenow, $is_iphone; + global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_iphone, $is_IE; if ( !isset( $wp_rich_edit) ) { - if ( get_user_option( 'rich_editing' ) == 'true' && - !$is_iphone && // this includes all Safari mobile browsers - ( ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 420 ) || - !preg_match( '!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT'] ) ) - ) { - $wp_rich_edit = true; - } else { - $wp_rich_edit = false; + $wp_rich_edit = false; + + if ( get_user_option( 'rich_editing' ) == 'true' ) { + if ( $is_safari ) { + if ( !$is_iphone || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 534 ) ) + $wp_rich_edit = true; + } elseif ( $is_gecko || $is_opera || $is_chrome || $is_IE ) { + $wp_rich_edit = true; + } } }