ZF-11249: preg_replace crash on long sql queries

Issue Type: Improvement Created: 2011-03-31T18:07:42.000+0000 Last Updated: 2011-07-28T13:27:46.000+0000 Status: Resolved Fix version(s): Reporter: Armand Turpel (aturp) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db

Related issues: - ZF-5063



Long queries crash php. It's due to the preg_replace function in file Zend/DB/Statement.php in function _stripQuoted in line:

$sql = preg_replace("/$q($qe|\\{2}|[^$q])*$q/", '', $sql);

In this case it is necessary to increase the pcre.backtrack_limit directive.

It toke me 2 hours to find why it crashes because no error or exception was throwed.

It would be useful to rewrite this function without preg_replace


Posted by Ralph Schindler (ralph) on 2011-04-01T17:19:27.000+0000

This is a duplicate of ZF-5063. In all honesty, this will not be a problem in ZF2, and due to BC issues, this likely won't be fixed in ZF version 1.x.

Posted by Patrick Schwisow (patrick.schwisow) on 2011-07-28T13:08:57.000+0000

This is your solution? Wait until ZF2 comes out and then mark it as "Won't fix"? There is a patch that would fix this posted 21/Sep/09. I've tried it and it works. I don't see any BC issues here.

Posted by Kai Uwe (kaiuwe) on 2011-07-28T13:27:46.000+0000


ZF-5063 is open! Also look at the last comment from "Georgy Korshunov": {quote}the patch doesn't work for me.{quote}

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.