From 9abc3c93748006642d8aafc105bd1258bc5b7da5 Mon Sep 17 00:00:00 2001 From: rob1n Date: Thu, 10 May 2007 01:31:12 +0000 Subject: [PATCH] Let WebKit 420 or above get in. And clean up that overgrown ternary. Props Andy. fixes #4241 git-svn-id: https://develop.svn.wordpress.org/trunk@5425 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/general-template.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index bf8f275037..c9acf2b85d 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -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); }