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

WordPress Trac noreply at wordpress.org
Wed Oct 1 02:04:08 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 kitchin):

 azaozz, I tested a patch that does essentially that, and it fails that
 following tests:

 {{{
 14.Test.. '<br [gallery ...] ... />'
 14.Actual '<br [gallery ...] … />'
 14.Expect '<br [gallery ...] ... />'
 24.Test.. '<br [[gallery ...]] ... />'
 24.Actual '<br [[gallery ...]] … />'
 24.Expect '<br [[gallery ...]] ... />'
 39.Test.. '<!-- <br /> [gallery] ... -->'
 39.Actual '<!-- <br /> [gallery] … –>'
 39.Expect '<!-- <br /> [gallery] ... -->'
 45.Test.. '[ regex catches this <a href="[quote]">here</a> ]'
 45.Actual '[ regex catches this <a href=”[quote]“>here</a> ]'
 45.Expect '[ regex catches this <a href="[quote]">here</a> ]'
 }}}

 My code uses better tag logic in the second part of your suggestion to
 catch comments (all done with strpos()), but it's the same idea. The
 reverse idea, tags first then shortcodes, also fails tests.

 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). To avoid running the regex twice I
 have some code that saves data on each part of the split match, but it's
 expensive so far.

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


More information about the wp-trac mailing list