Просмотр исходного кода

Fix search form for regex (#8226)

Wrongly quoted
Cherry-picked from https://github.com/FreshRSS/FreshRSS/pull/8131
Alexandre Alapetite 6 месяцев назад
Родитель
Сommit
8fdc574827
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      app/Controllers/searchController.php

+ 1 - 1
app/Controllers/searchController.php

@@ -52,7 +52,7 @@ class FreshRSS_search_Controller extends FreshRSS_ActionController {
 			if ($line === '') {
 				continue;
 			}
-			$quoted = preg_match('/\s/', $line) === 1 ? "'$line'" : $line;
+			$quoted = str_contains($line, ' ') && !str_starts_with($line, '/') ? "'$line'" : $line;
 			$terms[] = $prefix . $quoted;
 		}