]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/kses.php
WordPress 4.7
[autoinstalls/wordpress.git] / wp-includes / kses.php
index 8be3f79d565bfb7fc07facd73e417828bc7d32cb..4745d8d7efd8ef06450bc0788e90f04b665b98c4 100644 (file)
@@ -527,7 +527,6 @@ function wp_kses( $string, $allowed_html, $allowed_protocols = array() ) {
        if ( empty( $allowed_protocols ) )
                $allowed_protocols = wp_allowed_protocols();
        $string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );
-       $string = wp_kses_js_entities($string);
        $string = wp_kses_normalize_entities($string);
        $string = wp_kses_hook($string, $allowed_html, $allowed_protocols); // WP changed the order of these funcs and added args to wp_kses_hook
        return wp_kses_split($string, $allowed_html, $allowed_protocols);
@@ -550,7 +549,6 @@ function wp_kses_one_attr( $string, $element ) {
        $allowed_html = wp_kses_allowed_html( 'post' );
        $allowed_protocols = wp_allowed_protocols();
        $string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );
-       $string = wp_kses_js_entities( $string );
        
        // Preserve leading and trailing whitespace.
        $matches = array();
@@ -781,7 +779,7 @@ function wp_kses_split2($string, $allowed_html, $allowed_protocols) {
        }
        // Allow HTML comments
 
-       if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches))
+       if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9-]+)([^>]*)>?$%', $string, $matches))
                return '';
        // It's seriously malformed
 
@@ -1295,18 +1293,6 @@ function wp_kses_array_lc($inarray) {
        return $outarray;
 }
 
-/**
- * Removes the HTML JavaScript entities found in early versions of Netscape 4.
- *
- * @since 1.0.0
- *
- * @param string $string
- * @return string
- */
-function wp_kses_js_entities($string) {
-       return preg_replace('%&\s*\{[^}]*(\}\s*;?|$)%', '', $string);
-}
-
 /**
  * Handles parsing errors in wp_kses_hair().
  *