From 66ffc7f65e803ebe8895f561d6058564801b9711 Mon Sep 17 00:00:00 2001 From: Nicolas Potier Date: Fri, 6 Dec 2024 14:46:05 +0100 Subject: [PATCH] Fix deprecated fix : Deprecated: htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated --- Grid/Source/Source.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Grid/Source/Source.php b/Grid/Source/Source.php index f2605216..8d685548 100644 --- a/Grid/Source/Source.php +++ b/Grid/Source/Source.php @@ -576,6 +576,9 @@ protected function prepareStringForLikeCompare($input, $type = null) private function removeAccents($str) { + if (!is_string($str)) { + return $str; // Retourne l'entrée telle quelle si ce n'est pas une chaîne + } $entStr = htmlentities($str, ENT_NOQUOTES, 'UTF-8'); $noaccentStr = preg_replace('#&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);#', '\1', $entStr);