Update extrafields.class.php

This commit is contained in:
Vaadasch 2018-10-29 22:00:08 +01:00 committed by GitHub
parent 2b91067966
commit a4c7787d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1333,7 +1333,7 @@ class ExtraFields
// current object id can be use into filter // current object id can be use into filter
if (strpos($InfoFieldList[4], '$ID$')!==false && !empty($objectid)) { if (strpos($InfoFieldList[4], '$ID$')!==false && !empty($objectid)) {
$InfoFieldList[4]=str_replace('$ID$',$objectid,$InfoFieldList[4]); $InfoFieldList[4]=str_replace('$ID$',$objectid,$InfoFieldList[4]);
} else { } else if (preg_match("#^.*list.php$#",$_SERVER["DOCUMENT_URI"])) {
// Pattern for word=$ID$ // Pattern for word=$ID$
$word = '\b[a-zA-Z0-9-\.-_]+\b=\$ID\$'; $word = '\b[a-zA-Z0-9-\.-_]+\b=\$ID\$';
@ -1384,6 +1384,9 @@ class ExtraFields
preg_match('#(AND|OR|) *('.$word.') *(AND|OR|)#',$InfoFieldList[4],$matchCondition); preg_match('#(AND|OR|) *('.$word.') *(AND|OR|)#',$InfoFieldList[4],$matchCondition);
} }
} }
else {
$InfoFieldList[4]=str_replace('$ID$','0',$InfoFieldList[4]);
}
// We have to join on extrafield table // We have to join on extrafield table
if (strpos($InfoFieldList[4], 'extra') !== false) { if (strpos($InfoFieldList[4], 'extra') !== false) {