[wp-trac] [WordPress Trac] #35022: WP allows Unicode 0x00a0 spaces in editor but shortcode parser can't handle them

WordPress Trac noreply at wordpress.org
Sun Sep 18 14:09:22 UTC 2016


#35022: WP allows Unicode 0x00a0 spaces in editor but shortcode parser can't handle
them
--------------------------+-----------------------------
 Reporter:  steevithak    |       Owner:
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  Future Release
Component:  Shortcodes    |     Version:  4.4
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------------

Comment (by gitlost):

 Unfortunately it turns out that using a grouped expression with unlimited
 repetition can trigger seg faults or match failures in versions of PCRE <=
 8.12 (PHP <= 5.4.8, 5.3.18, 5.2) on large (~20K) matches.

 So what was a simple patch turns into something else...

 The new patch does some refactoring, putting the search for tagnames into
 its own function `get_shortcode_tagnames()` and putting the shortcode
 terminators into their own function `shortcode_name_terminators()`. The
 PCRE <= 8.12 restriction is got around by searching with the simple
 character class regex first and then post-processing. The good news is
 that this DRYs up some code, makes terminator matching consistent and
 reduces references to the `$shortcode_tags` global. The bad news we hold
 to be self-evident.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35022#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list