]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/kses.php
WordPress 4.0
[autoinstalls/wordpress.git] / wp-includes / kses.php
index 9d8d6fed1934fff3d2de3ec8617061d5c8f9efa7..0b552955e2fe2eb4ad96be778e9617393b8eefb0 100644 (file)
 if ( ! defined( 'CUSTOM_TAGS' ) )
        define( 'CUSTOM_TAGS', false );
 
+// Ensure that these variables are added to the global namespace
+// (e.g. if using namespaces / autoload in the current PHP environment).
+global $allowedposttags, $allowedtags, $allowedentitynames;
+
 if ( ! CUSTOM_TAGS ) {
        /**
         * Kses global for default allowable HTML tags.
@@ -987,7 +991,9 @@ function wp_kses_bad_protocol($string, $allowed_protocols) {
 }
 
 /**
- * Removes any null characters in $string.
+ * Removes any invalid control characters in $string.
+ *
+ * Also removes any instance of the '\0' string.
  *
  * @since 1.0.0
  *
@@ -995,7 +1001,7 @@ function wp_kses_bad_protocol($string, $allowed_protocols) {
  * @return string
  */
 function wp_kses_no_null($string) {
-       $string = preg_replace('/\0+/', '', $string);
+       $string = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F]/', '', $string);
        $string = preg_replace('/(\\\\0)+/', '', $string);
 
        return $string;