WordPress.org

Make WordPress Core

Ticket #22692: miqro-22692.2.patch

File miqro-22692.2.patch, 1.0 KB (added by miqrogroove, 7 years ago)

Patch improved based on ticket feedback.

  • wp-includes/formatting.php

     
    8787                if ( "'" != $apos )
    8888                        $dynamic[ '/(\S)\'([^\'\s])/'          ] = '$1' . $apos . '$2'; // apostrophe in a word
    8989                if ( '"' != $opening_quote )
    90                         $dynamic[ '/(\s|\A|[([{<])"(?!\s)/'    ] = '$1' . $opening_quote . '$2'; // opening double quote, even after (, {, <, [
     90                        $dynamic[ '/(?<=\A|[\s([{<]|\xC2\xA0)"(?=\S)/' ] = $opening_quote; // Any double quote at start, or preceded by space, (, {, <, [, or nbsp, and followed by a non-space.
    9191                if ( '"' != $closing_quote )
    92                         $dynamic[ '/"(\s|\S|\Z)/'              ] = $closing_quote . '$1'; // closing double quote
     92                        $dynamic[ '/"/'                        ] = $closing_quote; // Any remaining double quotes.
    9393                if ( "'" != $closing_single_quote )
    9494                        $dynamic[ '/\'([\s.]|\Z)/'             ] = $closing_single_quote . '$1'; // closing single quote
    9595