From 131ae92cc672c5ced53512477bd3b1267f976573 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 Feb 2022 21:05:23 +0100 Subject: [PATCH] FIX #20063 --- htdocs/core/class/html.form.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 23dd88d3151..811ad017c4d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7384,10 +7384,17 @@ class Form $objecttmp = null; + // Example of value for $objectdec: + // Bom:bom/class/bom.class.php:0:t.status=1 + // Bom:bom/class/bom.class.php:0:t.status=1:ref + // Bom:bom/class/bom.class.php:0:(t.status:=:1):ref $InfoFieldList = explode(":", $objectdesc, 4); $vartmp = $InfoFieldList[3]; - $InfoFieldList[4] = preg_replace('/^.*:(\w*)$/', '\1', $vartmp); // take the sort field - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field + $reg = array(); + if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { + $InfoFieldList[4] = $reg[1]; // take the sort field + } + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field $classname = $InfoFieldList[0]; $classpath = $InfoFieldList[1];