IdoQuery: Avoid passing `null` to preg_replace()

refs #4640
This commit is contained in:
Johannes Meyer 2022-04-19 15:00:55 +02:00
parent bc6b17b850
commit c5cf7abf0d
1 changed files with 4 additions and 0 deletions

View File

@ -874,6 +874,10 @@ abstract class IdoQuery extends DbQuery
'%1$s = %2$s.object_id AND LOWER(%2$s.varname) = %3$s';
foreach ($this->columnMap as $table => & $columns) {
foreach ($columns as $alias => & $column) {
if ($column === null) {
continue;
}
// Using a regex here because COLLATE may occur anywhere in the string
$column = preg_replace('/ COLLATE .+$/', '', $column, -1, $count);
if ($count > 0) {