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/
This commit is contained in:
wn_
2024-08-24 14:22:09 +00:00
parent a10f45cf67
commit 207d3dd48d

View File

@@ -2235,7 +2235,7 @@ class Feeds extends Handler_Protected {
* @return array{0: string, 1: array<int, string>} [$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();