From c5cf7abf0d40206cc5940e59936ddbba40dfb64a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 19 Apr 2022 15:00:55 +0200 Subject: [PATCH] IdoQuery: Avoid passing `null` to preg_replace() refs #4640 --- .../library/Monitoring/Backend/Ido/Query/IdoQuery.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php index b206d6243..eafe94bea 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php @@ -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) {