From 1fb0cdfd069c480b0910aba7b95b47c62adae55a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 31 Mar 2024 18:39:43 +0200 Subject: [PATCH] Unicode preg_split new line (#6247) fix https://github.com/FreshRSS/FreshRSS/issues/6236 https://php.net/reference.pcre.pattern.modifiers --- app/Services/ImportService.php | 4 ++-- lib/Minz/Request.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index 2c7d64f80..5c6cea8f3 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -183,7 +183,7 @@ class FreshRSS_Import_Service { if (isset($feed_elt['frss:filtersActionRead'])) { $feed->_filtersAction( 'read', - preg_split('/\R/', $feed_elt['frss:filtersActionRead']) ?: [] + preg_split('/\R/u', $feed_elt['frss:filtersActionRead']) ?: [] ); } @@ -268,7 +268,7 @@ class FreshRSS_Import_Service { $curl_params[CURLOPT_FOLLOWLOCATION] = (bool)$feed_elt['frss:CURLOPT_FOLLOWLOCATION']; } if (isset($feed_elt['frss:CURLOPT_HTTPHEADER'])) { - $curl_params[CURLOPT_HTTPHEADER] = preg_split('/\R/', $feed_elt['frss:CURLOPT_HTTPHEADER']) ?: []; + $curl_params[CURLOPT_HTTPHEADER] = preg_split('/\R/u', $feed_elt['frss:CURLOPT_HTTPHEADER']) ?: []; } if (isset($feed_elt['frss:CURLOPT_MAXREDIRS'])) { $curl_params[CURLOPT_MAXREDIRS] = (int)$feed_elt['frss:CURLOPT_MAXREDIRS']; diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 662dc6db9..6d099a555 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -120,7 +120,7 @@ class Minz_Request { */ public static function paramTextToArray(string $key, array $default = []): array { if (isset(self::$params[$key]) && is_string(self::$params[$key])) { - return preg_split('/\R/', self::$params[$key]) ?: []; + return preg_split('/\R/u', self::$params[$key]) ?: []; } return $default; }