WordPress.org

Make WordPress Core

Ticket #9821: wp_specialchars.2.diff

File wp_specialchars.2.diff, 718 bytes (added by sambauers, 5 years ago)
  • wordpress/wp-includes/formatting.php

     
    240240        } elseif ( $quote_style === 'single' ) { 
    241241                $quote_style = ENT_NOQUOTES; 
    242242        } 
    243  
     243         
    244244        // Handle double encoding ourselves 
    245245        if ( !$double_encode ) { 
    246246                $string = wp_specialchars_decode( $string, $_quote_style ); 
    247                 $string = preg_replace( '/&(#?x?[0-9]+|[a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string ); 
     247                $string = preg_replace( '/&(#?x?[0-9a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string ); 
    248248        } 
    249249 
    250250        $string = @htmlspecialchars( $string, $quote_style, $charset );