Make WordPress Core

Ticket #30856: 30856.diff

File 30856.diff, 814 bytes (added by mauteri, 10 years ago)

Adds a str_replace in wptexturize to replace curly quotes with straight quotes in shortcodes

  • wp-includes/formatting.php

     
    264264                } elseif ( '[' === $first && 1 === preg_match( '/^' . $shortcode_regex . '$/', $curl ) ) {
    265265                        // This is a shortcode delimiter.
    266266
     267                        // Replace any curly quotes with straight quotes in shortcodes
     268                        $quote_search = array( '“', '”', '‘', '’' );
     269                        $quote_replace = array( '"', '"', '\'', '\'' );
     270                        $curl = str_replace( $quote_search, $quote_replace, $curl );
     271                       
    267272                        if ( '[[' !== substr( $curl, 0, 2 ) && ']]' !== substr( $curl, -2 ) ) {
    268273                                // Looks like a normal shortcode.
    269274                                _wptexturize_pushpop_element( $curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes );