From 0a07505b2051a5de33cd2b68dc20cff81f57f0ae Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 22 Jul 2024 21:16:08 +0200 Subject: [PATCH] widen regular expression for sort-column to allow custom fields with relative arbitrary name (letters, numbers, space) --- api/src/Etemplate/Widget/Nextmatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget/Nextmatch.php b/api/src/Etemplate/Widget/Nextmatch.php index fc4eec4494..7da14aa1b2 100644 --- a/api/src/Etemplate/Widget/Nextmatch.php +++ b/api/src/Etemplate/Widget/Nextmatch.php @@ -336,7 +336,7 @@ class Nextmatch extends Etemplate\Widget // Parse sort into something that get_rows functions are expecting: db_field in order, ASC/DESC in sort if(is_array($value['sort'])) { - $value['order'] = preg_match('/^[a-z0-9_]+$/', $value['sort']['id']) ? $value['sort']['id'] : ''; + $value['order'] = preg_match('/^(#[a-z0-9 _]+|[a-z0-9_]+)$/i', $value['sort']['id']) ? $value['sort']['id'] : ''; $value['sort'] = $value['sort']['asc'] ? 'ASC' : 'DESC'; }