Skip to content

Commit 3071cd8

Browse files
committed
fix php 8.1 deprecation issues caused by preg_replace error
1 parent 83f34f5 commit 3071cd8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/Zend/Db/Statement.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ protected function _stripQuoted($sql)
198198
$sql = preg_replace("/$q([^$q{$escapeChar}]*|($qe)*)*$q/s", '', $sql);
199199
}
200200

201+
if ($sql === null) {
202+
// this preg_replace may return NULL in case of error (PREG_BACKTRACK_LIMIT_ERROR).
203+
// In that case the result of this method will be an empty string.
204+
return '';
205+
}
206+
201207
// get a version of the SQL statement with all quoted
202208
// values and delimited identifiers stripped out
203209
// remove "foo\"bar"

0 commit comments

Comments
 (0)