summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwn_ <[email protected]>2024-08-24 14:22:09 +0000
committerwn_ <[email protected]>2024-08-24 14:22:12 +0000
commit207d3dd48d5667f8aac1847bd2f52ed3a4f70baf (patch)
tree8c07680bfbc9ef2f4d86f8024c3643d2659de4e1
parenta10f45cf673301aeb5dc5fa53e330283fbb56d7c (diff)
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/
-rw-r--r--classes/Feeds.php2
1 files changed, 1 insertions, 1 deletions
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<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();