]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/kses.php
Wordpress 3.1.4-scripts
[autoinstalls/wordpress.git] / wp-includes / kses.php
index 7ca692f51a8b36b77438d6b50dc96d6bd75fdb17..aea7aa81da6b689b06bd05410df1f41f68e319d5 100644 (file)
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  or visit
  * http://www.gnu.org/licenses/gpl.html
- * 
+ *
  * [kses strips evil scripts!]
  *
  * Added wp_ prefix to avoid conflicts with existing kses users
@@ -28,6 +28,7 @@
  *
  * @package External
  * @subpackage KSES
+ *
  */
 
 /**
@@ -553,8 +554,18 @@ 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;
-       return preg_replace_callback('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%',
-               create_function('$match', 'global $pass_allowed_html, $pass_allowed_protocols; return wp_kses_split2($match[1], $pass_allowed_html, $pass_allowed_protocols);'), $string);
+       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 );
 }
 
 /**