From 99f52110703a22810f854c60645050c414dbffbe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Nov 2015 11:48:35 +0100 Subject: [PATCH] NEW Can use the * as a joker characters into search boxes of lists --- htdocs/core/lib/functions.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index db59c8d966d..013217a9f57 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5193,6 +5193,10 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) { global $db,$langs; + if ($mode == 0) + { + $value=preg_replace('/\*/','%',$value); // Replace * with % + } if ($mode == 1) { $value=preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do