Make WordPress Core

Changeset 5425


Ignore:
Timestamp:
05/10/2007 01:31:12 AM (18 years ago)
Author:
rob1n
Message:

Let WebKit 420 or above get in. And clean up that overgrown ternary. Props Andy. fixes #4241

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r5248 r5425  
    810810function user_can_richedit() {
    811811    global $wp_rich_edit, $pagenow;
    812 
    813     if ( !isset($wp_rich_edit) )
    814         $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;
     812   
     813    if ( !isset( $wp_rich_edit) ) {
     814        if ( get_user_option( 'rich_editing' ) == 'true' &&
     815            ( ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 420 ) ||
     816                !preg_match( 'opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT'] ) ) ) {
     817            $wp_rich_edit = true;
     818        } else {
     819            $wp_rich_edit = false;
     820        }
     821    }
    815822
    816823    return apply_filters('user_can_richedit', $wp_rich_edit);
Note: See TracChangeset for help on using the changeset viewer.