[wp-trac] [WordPress Trac] #29557: PHP ≤ 5.4.8 Crashes on '[' Character in Posts

WordPress Trac noreply at wordpress.org
Thu Oct 30 17:24:19 UTC 2014


#29557: PHP ≤ 5.4.8 Crashes on '[' Character in Posts
------------------------------------------------------+--------------------
 Reporter:  MrBobDobolina                             |       Owner:
     Type:  defect (bug)                              |      Status:  new
 Priority:  highest omg bbq                           |   Milestone:  4.0.1
Component:  Formatting                                |     Version:  4.0
 Severity:  blocker                                   |  Resolution:
 Keywords:  wptexturize has-patch commit fixed-major  |     Focuses:
------------------------------------------------------+--------------------

Comment (by miqrogroove):

 Replying to [comment:84 miqrogroove]:
 > Replying to [comment:83 kitchin]:
 > > Miqro's patch is ideal for the current tests, with one caveat: the tag
 regex is executed twice for each match (once in the implicit `preg_split`
 loop and once in the `foreach` loop).
 >
 > preg_match_all() might be able to structure the results better than
 preg_split().  I'm not sure what the speed differences would be.  Also,
 I'm not sure there would be any elegant way to capture the parts between
 the tags.

 Looks like PREG_OFFSET_CAPTURE gives us the data we need, and all that's
 needed is a tweak to the capturing groups.  There might be benefits also
 from not splitting the string.  I'm wondering if we can do a similar
 match_all using the full shortcode regexp and then loop through the
 results with some magical algebra.  I'll play with that idea more as time
 allows.

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


More information about the wp-trac mailing list