ZF-11249: preg_replace crash on long sql queries


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


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.

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.


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