### Eclipse Workspace Patch 1.0
#P wordpress
Index: wp-includes/kses.php
===================================================================
--- wp-includes/kses.php	(revision 17198)
+++ wp-includes/kses.php	(working copy)
@@ -551,24 +551,11 @@
  * @return string Content with fixed HTML tags
  */
 function wp_kses_split($string, $allowed_html, $allowed_protocols) {
-	global $pass_allowed_html, $pass_allowed_protocols;
-	$pass_allowed_html = $allowed_html;
-	$pass_allowed_protocols = $allowed_protocols;
+	$GLOBALS['pass_allowed'] = array( $allowed_html, $allowed_protocols );
 	return preg_replace_callback( '%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%', '_wp_kses_split_callback', $string );
 }
 
 /**
- * Callback for wp_kses_split.
- *
- * @since 3.1.0
- * @access private
- */
-function _wp_kses_split_callback( $match ) {
-	global $pass_allowed_html, $pass_allowed_protocols;
-	return wp_kses_split2( $match[1], $pass_allowed_html, $pass_allowed_protocols );
-}
-
-/**
  * Callback for wp_kses_split for fixing malformed HTML tags.
  *
  * This function does a lot of work. It rejects some very malformed things like
@@ -580,17 +567,15 @@
  * through another filter which will remove illegal attributes and once that is
  * completed, will be returned.
  *
+ * @since 3.1.0
  * @access private
- * @since 1.0.0
  * @uses wp_kses_attr()
- *
- * @param string $string Content to filter
- * @param array $allowed_html Allowed HTML elements
- * @param array $allowed_protocols Allowed protocols to keep
+ * @param array $match matches as of preg_match_callback()
  * @return string Fixed HTML element
  */
-function wp_kses_split2($string, $allowed_html, $allowed_protocols) {
-	$string = wp_kses_stripslashes($string);
+function _wp_kses_split_callback( $match ) {
+	list( $allowed_html, $allowed_protocols ) = $GLOBALS['pass_allowed'];
+	$string = wp_kses_stripslashes( $match[1] );
 
 	if (substr($string, 0, 1) != '<')
 		return '&gt;';
@@ -630,6 +615,26 @@
 }
 
 /**
+ * deprecated function
+ * 
+ * @see _wp_kses_split_callback()
+ * 
+ * @access private
+ * @since 1.0.0
+ *
+ * @param string $string Content to filter
+ * @param array $allowed_html Allowed HTML elements
+ * @param array $allowed_protocols Allowed protocols to keep
+ * @return string Fixed HTML element
+ */
+function wp_kses_split2($string, $allowed_html, $allowed_protocols) {
+	$GLOBALS['pass_allowed'] = array( $allowed_html, $allowed_protocols );
+	$match = array( 1 => $string);
+	_deprecated_function( 'wp_kses_split2', '3.0' );
+	return _wp_kses_split_callback( $match );
+}
+
+/**
  * Removes all attributes, if none are allowed for this element.
  *
  * If some are allowed it calls wp_kses_hair() to split them further, and then
