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

git-svn-id: https://develop.svn.wordpress.org/trunk@18071 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2011-05-29 21:18:58 +00:00
parent 25431a16bb
commit be987907b8

View File

@ -1649,7 +1649,7 @@ function wp_tiny_mce( $teeny = false, $settings = false ) {
$val = $v ? 'true' : 'false';
$mce_options .= $k . ':' . $val . ', ';
continue;
} elseif ( !empty($v) && is_string($v) && ( '{' == $v{0} || '[' == $v{0} || preg_match('/^\(?function ?\(/', $v) ) ) {
} elseif ( is_string($v) && ( ('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v) ) ) {
$mce_options .= $k . ':' . $v . ', ';
continue;
}