diff --git a/library/Zend/Db/Statement.php b/library/Zend/Db/Statement.php index 46d175c..b4307ab 100644 --- a/library/Zend/Db/Statement.php +++ b/library/Zend/Db/Statement.php @@ -209,6 +209,12 @@ protected function _stripQuoted($sql) // remove "foo\"bar" $sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql); + if ($sql === null) { + // this preg_replace call can return NULL in case of error (PREG_BACKTRACK_LIMIT_ERROR). + // In this case the result of this method will be an empty string. + return ''; + } + // get the character for delimited id quotes, // this is usually " but in MySQL is ` $d = $this->_adapter->quoteIdentifier('a');