WordPress.org

Make WordPress Core

Changeset 18071


Ignore:
Timestamp:
05/29/2011 09:18:58 PM (8 years ago)
Author:
azaozz
Message:

Improve JS array/object detection when outputting the TinyMCE init array.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r18053 r18071  
    16501650            $mce_options .= $k . ':' . $val . ', ';
    16511651            continue;
    1652         } elseif ( !empty($v) && is_string($v) && ( '{' == $v{0} || '[' == $v{0} || preg_match('/^\(?function ?\(/', $v) ) ) {
     1652        } elseif ( is_string($v) && ( ('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v) ) ) {
    16531653            $mce_options .= $k . ':' . $v . ', ';
    16541654            continue;
Note: See TracChangeset for help on using the changeset viewer.