[wp-trac] Re: [WordPress Trac] #8553: preg_replace_callback in do_shortcode returns empty for large posts

WordPress Trac wp-trac at lists.automattic.com
Tue Dec 30 11:21:17 GMT 2008


#8553: preg_replace_callback in do_shortcode returns empty for large posts
---------------------------+------------------------------------------------
 Reporter:  AaronCampbell  |        Owner:  anonymous
     Type:  defect (bug)   |       Status:  new      
 Priority:  normal         |    Milestone:  2.7.1    
Component:  General        |      Version:           
 Severity:  normal         |   Resolution:           
 Keywords:  needs-patch    |  
---------------------------+------------------------------------------------
Comment (by Denis-de-Bernardy):

 this bracktrack stuff is soooo annoying. not to mention the complete lack
 of error messages that comes with it. it really makes one wonder why they
 added pcre into php. I mean, php5.2 renders pcre completely useless except
 for the most basic patterns.

 In case it helps, I ended up fixing this on my end by doing less work in
 each regexp. That is, instead of matching exactly what I needed, and
 catching everything I needed, all in one go, I ended up using multiple
 calls to preg_match, preg_replace, and preg_replace_callback...

 and yes, that's another way of saying gobbling more php resources to work
 around a limit on resources imposed by php. :D

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8553#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list