Let WebKit 420 and above in for TinyMCE. fixes #4241 for 2.2

git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@5443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-05-11 01:00:30 +00:00
parent 9532679648
commit c3fc60a2ee
1 changed files with 10 additions and 3 deletions

View File

@ -809,9 +809,16 @@ function rich_edit_exists() {
function user_can_richedit() {
global $wp_rich_edit, $pagenow;
if ( !isset($wp_rich_edit) )
$wp_rich_edit = ( 'true' == get_user_option('rich_editing') && !preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) && 'comment.php' != $pagenow && rich_edit_exists() ) ? true : false;
if ( !isset( $wp_rich_edit) ) {
if ( get_user_option( 'rich_editing' ) == 'true' &&
( ( 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;
}
}
return apply_filters('user_can_richedit', $wp_rich_edit);
}