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

WordPress Trac noreply at wordpress.org
Wed Oct 8 00:34:47 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  |     Focuses:
-----------------------------------+--------------------

Comment (by miqrogroove):

 Replying to [comment:87 kovshenin]:
 > However, I think we need to take a step back, revert everything to 3.9
 behavior in 4.0.1 and revisit some of these ideas in 4.1:

 What is your reason for a revert?  The trunk version is patched and fixes
 all concerns raised in this ticket.  If you have new concerns, speak now.
 :)

 > If we're going to match shortcodes, why aren't we using the existing
 cached shortcode regex?

 1. As kitchin pointed out, the cached shortcode regex does not match
 wptexturize() 3.9 behavior and breaks pre-trunk versions of Jetpack.
 1. The cached shortcode regex is incompatible with the HTML parsing
 strategy.
 1. The cached shortcode regex requires a recursive algorithm.
 1. Having a simplified pattern here is not a reason to revert all the
 patches for 4.0.

 > "Adding preg_split() inside a loop does not seem like a good direction
 for performance." - why not? How is it different from using preg_match()
 inside a loop?

 You are welcome to run some benchmarks of using alternation one time vs.
 using preg_split against every result of a first split.  It is unlikely to
 improve performance, and it is a red herring in terms of texturization
 behavior.  We have no algorithmic need to do that.

 > I like @azaozz's idea of splitting the regex into smaller managable,
 consistent and possibly reusable chunks

 This is happening somewhat in #29810 and does not seem relevant to 4.0.1.

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


More information about the wp-trac mailing list