From c87f24e3f493b111bf0312fbbd3cc1da8925804a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Mar 2024 17:09:36 +0100 Subject: [PATCH] Fix mysqli --- htdocs/core/db/mysqli.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 485477d052d..c98732c2d06 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -518,6 +518,7 @@ class DoliDBMysqli extends DoliDB */ public function escapeforlike($stringtoencode) { + // We must first replace the \ char into \\, then we can replace _ and % into \_ and \% return str_replace(array('\\', '_', '%'), array('\\\\', '\_', '\%'), (string) $stringtoencode); }