[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
Wed Mar 16 21:42: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 steevithak):

 Ok, I think I answered my own question. Ticket #33517 identified
 performance problems with WP posts containing massive numbers of
 shortcodes. If I'm understanding what happened correctly, a patch was
 applied that greatly improved performance by allowing the various parsing
 functions to make quickie passes through the post content, pulling out a
 list of shortcode tags using simplified regexes (that, for example, don't
 bother to properly identify every possible type of space character, just
 the most common ones). The patch for that bug appears to coincide with
 both the creation of this bug and the proliferation of alternate regexes
 I'm seeing. Give that we're worried about regex performance issues here,
 maybe the best we can hope for is to extend the hack that's already in
 shortcode_parse_atts() and just do a global replace of all other space
 chars with an 0x20 prior to running the regex. That seems less likely to
 bring back performance issues for people who have many hundreds of
 shortcodes than what I proposed in the original bug report.

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


More information about the wp-trac mailing list