diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 21bf3cb1af4..844777fc6fc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7102,7 +7102,7 @@ abstract class CommonObject //print $sql; // Note: $InfoFieldList can be 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:CategoryIdType[:CategoryIdList[:Sortfield]]]]]]' - if (isset($InfoFieldList[7]) && preg_match('/^[a-z0-9_-,]+$/i, $InfoFieldList[7]) { + if (isset($InfoFieldList[7]) && preg_match('/^[a-z0-9_-,]+$/i', $InfoFieldList[7])) { $sql .= " ORDER BY ".$this->db->escape($InfoFieldList[7]); } else { $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));