From 8c54f472e6cf5699be79eb80c47f71cb540c5e51 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sun, 17 Nov 2024 13:13:13 +0700 Subject: [PATCH] [PHP 8.4] str_getcsv: Fix $escape parameter deprecation In PHP 8.4, not passing the `$escape` parameter to the `str_getcsv` function emits a deprecation error. This fixes the notice by passing the identical default value for the `$escape` parameter. - [Initiating RFC](https://wiki.php.net/rfc/kill-csv-escaping) - [Deprecation RFC](https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_proprietary_csv_escaping_mechanism) - [PHP 8.4: CSV: The `$escape` parameter must be provided](https://php.watch/versions/8.4/csv-functions-escape-parameter) Signed-off-by: Ayesh Karunaratne --- libraries/classes/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/classes/Util.php b/libraries/classes/Util.php index ee9833747a..689830db2a 100644 --- a/libraries/classes/Util.php +++ b/libraries/classes/Util.php @@ -1913,7 +1913,7 @@ class Util // It future replace str_getcsv with $dbi->fetchSingleRow('SELECT '.$expressionInBrackets[1]); preg_match('/\((.*)\)/', $definition, $expressionInBrackets); - $matches = str_getcsv($expressionInBrackets[1], ',', "'"); + $matches = str_getcsv($expressionInBrackets[1], ',', "'", '\\'); $values = []; foreach ($matches as $value) {