WordPress.org

Make WordPress Core

Changeset 18963


Ignore:
Timestamp:
10/13/2011 06:37:24 AM (7 years ago)
Author:
azaozz
Message:

Update user_can_richedit to allow TinyMCE in iOS5, props markoheijnen, fixes #18626

File:
1 edited

Legend:

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

    r18907 r18963  
    17141714 */
    17151715function user_can_richedit() {
    1716     global $wp_rich_edit, $pagenow, $is_iphone;
     1716    global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_iphone, $is_IE;
    17171717
    17181718    if ( !isset( $wp_rich_edit) ) {
    1719         if ( get_user_option( 'rich_editing' ) == 'true' &&
    1720             !$is_iphone && // this includes all Safari mobile browsers
    1721             ( ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 420 ) ||
    1722                 !preg_match( '!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT'] ) )
    1723         ) {
    1724             $wp_rich_edit = true;
    1725         } else {
    1726             $wp_rich_edit = false;
     1719        $wp_rich_edit = false;
     1720
     1721        if ( get_user_option( 'rich_editing' ) == 'true' ) {
     1722            if ( $is_safari ) {
     1723                if ( !$is_iphone || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 534 ) )
     1724                    $wp_rich_edit = true;
     1725            } elseif ( $is_gecko || $is_opera || $is_chrome || $is_IE ) {
     1726                $wp_rich_edit = true;
     1727            }
    17271728        }
    17281729    }
Note: See TracChangeset for help on using the changeset viewer.