Make WordPress Core


Ignore:
Timestamp:
06/17/2014 08:13:54 PM (10 years ago)
Author:
wonderboymusic
Message:

In wptexturize(), adjust for the treatment of abbreviated years at the end of quotations.
Silence some unit tests that have never passed and may no longer be applicable.

Props miqrogroove.
Fixes #18549.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r28763 r28764  
    103103        $dynamic = array();
    104104
    105         // '99' is an ambiguous case among other patterns; assume it's an abbreviated year at the end of a quotation.
    106         if ( "'" !== $apos && "'" !== $closing_single_quote ) {
     105        // '99' and '99" are ambiguous among other patterns; assume it's an abbreviated year at the end of a quotation.
     106        if ( "'" !== $apos || "'" !== $closing_single_quote ) {
    107107            $dynamic[ '/\'(\d\d)\'(?=\Z|[.,)}>\-\]]|' . $spaces . ')/' ] = $apos . '$1' . $closing_single_quote;
     108        }
     109
     110        if ( "'" !== $apos || '"' !== $closing_quote ) {
     111            $dynamic[ '/\'(\d\d)"(?=\Z|[.,)}>\-\]]|' . $spaces . ')/' ] = $apos . '$1' . $closing_quote;
    108112        }
    109113
     
    127131
    128132        // Apostrophe in a word.  No spaces, double apostrophes, or other punctuation.
    129         if ( "'" != $apos ) {
     133        if ( "'" !== $apos ) {
    130134            $dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|[.,:;"\'(){}<>[\]\-]|' . $spaces . ')/' ] = $apos;
    131135        }
     
    152156
    153157        // Single quotes followed by spaces or ending punctuation.
    154         if ( "'" != $closing_single_quote ) {
     158        if ( "'" !== $closing_single_quote ) {
    155159            $dynamic[ '/\'(?=\Z|[.,)}>\-\]]|' . $spaces . ')/' ] = $closing_single_quote;
    156160        }
Note: See TracChangeset for help on using the changeset viewer.