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

WordPress Trac noreply at wordpress.org
Tue Oct 7 14:29: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 kovshenin):

 Per @miqrogroove's comment my assumption in #12690 was indeed wrong. The
 greediness did apply to the matched group, but the alteration within the
 group still allowed unnecessary backtracking, and without some of the
 newer optimizations in older PHP versions we get a segfault. Making
 `[^\[\]<>]` greedy in all three expressions should solve this specific
 backtracking issue.

 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:

 * If we're going to match shortcodes, why aren't we using the existing
 cached shortcode regex?
 * "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?
 * I like @azaozz's idea of splitting the regex into smaller managable,
 consistent and possibly reusable chunks

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


More information about the wp-trac mailing list