From 207d3dd48d5667f8aac1847bd2f52ed3a4f70baf Mon Sep 17 00:00:00 2001 From: wn_ Date: Sat, 24 Aug 2024 14:22:09 +0000 Subject: Set 'str_getcsv' escape param to empty string to avoid PHP 8.4 deprecation message. The escape param is in the process of being eliminated, with PHP 8.4 deprecating passing anything but an empty string as its value. For some reason they're leaving the default value (a backslash) as-is, meaning the default will cause a deprecation message. This commit avoids that by setting the escape param to an empty string (see references below). * https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_proprietary_csv_escaping_mechanism * https://www.php.net/manual/en/function.str-getcsv.php * https://old.reddit.com/r/PHP/comments/1eyum8c/new_deprecation_notices_in_php84_with_csv/ * https://nyamsprod.com/blog/csv-and-php8-4/ --- classes/Feeds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Feeds.php b/classes/Feeds.php index b58c7f3b6..71379762f 100644 --- a/classes/Feeds.php +++ b/classes/Feeds.php @@ -2235,7 +2235,7 @@ class Feeds extends Handler_Protected { * @return array{0: string, 1: array} [$search_query_part, $search_words] */ private static function _search_to_sql(string $search, string $search_language, int $owner_uid): array { - $keywords = str_getcsv(preg_replace('/(-?\w+)\:"(\w+)/', '"{$1}:{$2}', trim($search)), ' '); + $keywords = str_getcsv(preg_replace('/(-?\w+)\:"(\w+)/', '"{$1}:{$2}', trim($search)), ' ', '"', ''); $query_keywords = array(); $search_words = array(); $search_query_leftover = array(); -- cgit v1.2.3-54-g00ecf