WordPress.org

Make WordPress Core

Changeset 31965


Ignore:
Timestamp:
04/01/2015 07:08:31 PM (5 years ago)
Author:
wonderboymusic
Message:

Alter the regex in wptexturize() to properly handle input like: <> "Hello world" <>.

Updates unit test data.

Props miqrogroove.
Fixes #30344.

Location:
trunk
Files:
2 edited

Legend:

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

    r31938 r31965  
    236236        .         $comment_regex // Find end of comment.
    237237        .     '|'
    238         .         '[^>]+>'       // Find end of element.
     238        .         '[^>]*>'       // Find end of element.
    239239        .     ')'
    240240        . '|'
  • trunk/tests/phpunit/tests/formatting/WPTexturize.php

    r31249 r31965  
    13931393                '[Let\'s get crazy<input>[caption code="<a href=\'?a[]=100\'>hello</a>"]</input>world]', // caption shortcode is invalid here because it contains [] chars.
    13941394                '[Let&#8217;s get crazy<input>[caption code=&#8221;<a href=\'?a[]=100\'>hello</a>&#8220;]</input>world]',
     1395            ),
     1396            array(
     1397                '<> ... <>',
     1398                '<> &#8230; <>',
     1399            ),
     1400            array(
     1401                '<> ... <> ... >',
     1402                '<> &#8230; <> &#8230; >',
     1403            ),
     1404            array(
     1405                '<> ... < ... > ... <>',
     1406                '<> &#8230; < ... > &#8230; <>',
    13951407            ),
    13961408        );
Note: See TracChangeset for help on using the changeset viewer.