From 925af263fcafab39e9f4f4cfb99443ede96169d9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 9 Oct 2012 18:54:21 +0200 Subject: [PATCH] Fix: best test --- htdocs/societe/class/societe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 63c546b85b7..7599ef5f18f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -863,7 +863,7 @@ class Societe extends CommonObject { if (! $exact) { - if (preg_match('/^([\*]+)[^*]+([\*]+)$/', $name)) + if (preg_match('/^([\*])?[^*]+([\*])?$/', $name, $regs) && count($regs) > 1) { $name = str_replace('*', '%', $name); } @@ -886,7 +886,7 @@ class Societe extends CommonObject { if (! $exact) { - if (preg_match('/^([\*]+)[^*]+([\*]+)$/', $value)) + if (preg_match('/^([\*])?[^*]+([\*])?$/', $value, $regs) && count($regs) > 1) { $value = str_replace('*', '%', $value); }