WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/26/2014 05:14:47 PM (7 years ago)
Author:
wonderboymusic
Message:

Use less greedy regex in wptexturize(). Adds unit tests.

Props miqrogroove.
See #28564.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/WPTexturize.php

    r28831 r28852  
    13051305                'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word', // Ensure we are not corrupting image URLs.
    13061306                'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word',
     1307            ),
     1308            array(
     1309                '[ do texturize "[quote]" here ]',
     1310                '[ do texturize &#8220;[quote]&#8221; here ]',
     1311            ),
     1312            array(
     1313                '[ regex catches this <a href="[quote]">here</a> ]',
     1314                '[ regex catches this <a href="[quote]">here</a> ]',
     1315            ),
     1316            array(
     1317                '[ but also catches the <b>styled "[quote]" here</b> ]',
     1318                '[ but also catches the <b>styled &#8220;[quote]&#8221; here</b> ]',
     1319            ),
     1320            array(
     1321                '[Let\'s get crazy<input>[plugin code="<a href=\'?a[]=100\'>hello</a>"]</input>world]',
     1322                '[Let&#8217;s get crazy<input>[plugin code="<a href=\'?a[]=100\'>hello</a>"]</input>world]',
    13071323            ),
    13081324        );
Note: See TracChangeset for help on using the changeset viewer.