Make WordPress Core


Ignore:
Timestamp:
09/29/2014 04:06:54 AM (11 years ago)
Author:
wonderboymusic
Message:

The joys of wptexturize():

  • Revert parts of [28773] and [28727] and [29748].
  • Do not crash PHP. Make the shortcode quantifier possessive to avoid backtracks.
  • Reduce backtracking in long HTML comments by 100x.
  • Do not ignore unclosed HTML comments.
  • Do not break unregistered shortcodes, e.g. [hello attr="value"].
  • Do not break HTML in shortcode attributes, e.g. [hello attr="<"].
  • Do not match for shortcodes when there is extra whitespace, e.g. [ hello ].
  • Add unit tests to show #12690 was not fully resolved.
  • Tested PHP 5.2.4, 5.2.13, 5.4.32, and 5.5.8.

Adds/modifies unit tests.

Props miqrogroove.
See #29557.

File:
1 edited

Legend:

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

    r29748 r29781  
    232232
    233233    // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag()
    234     // Also, see shortcode_unautop() and shortcode.js and wptexturize().
     234    // Also, see shortcode_unautop() and shortcode.js.
    235235    return
    236236          '\\['                              // Opening bracket
Note: See TracChangeset for help on using the changeset viewer.