ZF-11249: preg_replace crash on long sql queries
Description
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
Comments
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
@Patrick
ZF-5063 is open! Also look at the last comment from "Georgy Korshunov": {quote}the patch doesn't work for me.{quote}