Make WordPress Core

Ticket #40575: 40575.patch

File 40575.patch, 1.6 KB (added by ketuchetan, 9 years ago)
  • src/wp-includes/kses.php

     
    549549        $allowed_html = wp_kses_allowed_html( 'post' );
    550550        $allowed_protocols = wp_allowed_protocols();
    551551        $string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );
    552        
     552
    553553        // Preserve leading and trailing whitespace.
    554554        $matches = array();
    555555        preg_match('/^\s*/', $string, $matches);
     
    561561        } else {
    562562                $string = substr( $string, strlen( $lead ), -strlen( $trail ) );
    563563        }
    564        
     564
    565565        // Parse attribute name and value from input.
    566566        $split = preg_split( '/\s*=\s*/', $string, 2 );
    567567        $name = $split[0];
     
    598598                $value = '';
    599599                $vless = 'y';
    600600        }
    601        
     601
    602602        // Sanitize attribute by name.
    603603        wp_kses_attr_check( $name, $value, $string, $vless, $element, $allowed_html );
    604604
     
    633633                 * @param string $context Context to judge allowed tags by. Allowed values are 'post',
    634634                 *                        'data', 'strip', 'entities', 'explicit', or the name of a filter.
    635635                 */
    636                 return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' );
     636                return apply_filters( 'wp_kses_allowed_html', $tags, 'explicit' );
    637637        }
    638638
    639639        switch ( $context ) {
     
    10611061        } else {
    10621062                $xhtml_slash = '';
    10631063        }
    1064        
     1064
    10651065        // Split it
    10661066        $attrarr = wp_kses_hair_parse( $attr );
    10671067        if ( false === $attrarr ) {
     
    10711071        // Make sure all input is returned by adding front and back matter.
    10721072        array_unshift( $attrarr, $begin . $slash . $elname );
    10731073        array_push( $attrarr, $xhtml_slash . $end );
    1074        
     1074
    10751075        return $attrarr;
    10761076}
    10771077