From 7536a1107e382c7f25e4b78c6ec75d804aa338ea Mon Sep 17 00:00:00 2001 From: azaozz Date: Sun, 29 May 2011 21:18:58 +0000 Subject: [PATCH] Improve JS array/object detection when outputting the TinyMCE init array. git-svn-id: http://svn.automattic.com/wordpress/trunk@18071 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index bd67fcd9ed..7b23e54559 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -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; }