From f6249e9ad81212ea4f15bf6a83fa98c4cd457c49 Mon Sep 17 00:00:00 2001 From: ralf Date: Wed, 2 Aug 2023 11:50:09 +0200 Subject: [PATCH] * PostgreSQL/Mail: fix SQL error querying email avatars --- api/src/Contacts/Sql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Contacts/Sql.php b/api/src/Contacts/Sql.php index 88e5dac401..5647352ade 100644 --- a/api/src/Contacts/Sql.php +++ b/api/src/Contacts/Sql.php @@ -623,7 +623,7 @@ class Sql extends Api\Storage } // postgres requires that expressions in order by appear in the columns of a distinct select $all_matches = null; - if (substr($this->db->Type, 0, 5) !== 'mysql' && preg_match_all("/(#?[a-zA-Z_.]+) *(<> *''|IS NULL|IS NOT NULL)? *(ASC|DESC)?(,|$)/ui", + if (substr($this->db->Type, 0, 5) !== 'mysql' && preg_match_all("/(#?[a-zA-Z_.]+) *(<> *''|IS NULL|IS NOT NULL|& *\d+)? *(ASC|DESC)?(,|$)/ui", $order_by, $all_matches, PREG_SET_ORDER)) { if (!is_array($extra_cols)) $extra_cols = $extra_cols ? explode(',',$extra_cols) : array();