From b323ed084620cac2222fe1c93ec05b9773eb81e6 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 16 Sep 2018 10:46:27 +0200 Subject: Improve authors (#2025) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Links for authors and multiple authors Favour ';' as a separator instead of ',' to better cope with multi-author scientific articles. Follow-up of https://github.com/FreshRSS/FreshRSS/pull/1997 , https://github.com/FreshRSS/FreshRSS/issues/1968, https://github.com/FreshRSS/FreshRSS/pull/2023 * Change i18n authors * Update layout * Unicode-compatible search Example for `author:Loïc` * author styling * Final details * Minor spacing --- app/Models/Search.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Models/Search.php') diff --git a/app/Models/Search.php b/app/Models/Search.php index c338d63a1..c52e391fa 100644 --- a/app/Models/Search.php +++ b/app/Models/Search.php @@ -141,7 +141,7 @@ class FreshRSS_Search { $this->intitle = $matches['search']; $input = str_replace($matches[0], '', $input); } - if (preg_match_all('/\bintitle:(?P[\w+]*)/', $input, $matches)) { + if (preg_match_all('/\bintitle:(?P[^\s"]*)/', $input, $matches)) { $this->intitle = array_merge($this->intitle ? $this->intitle : array(), $matches['search']); $input = str_replace($matches[0], '', $input); } @@ -155,7 +155,7 @@ class FreshRSS_Search { $this->not_intitle = $matches['search']; $input = str_replace($matches[0], '', $input); } - if (preg_match_all('/[!-]intitle:(?P[\w+]*)/', $input, $matches)) { + if (preg_match_all('/[!-]intitle:(?P[^\s"]*)/', $input, $matches)) { $this->not_intitle = array_merge($this->not_intitle ? $this->not_intitle : array(), $matches['search']); $input = str_replace($matches[0], '', $input); } @@ -179,7 +179,7 @@ class FreshRSS_Search { $this->author = $matches['search']; $input = str_replace($matches[0], '', $input); } - if (preg_match_all('/\bauthor:(?P[\w+]*)/', $input, $matches)) { + if (preg_match_all('/\bauthor:(?P[^\s"]*)/', $input, $matches)) { $this->author = array_merge($this->author ? $this->author : array(), $matches['search']); $input = str_replace($matches[0], '', $input); } @@ -193,7 +193,7 @@ class FreshRSS_Search { $this->not_author = $matches['search']; $input = str_replace($matches[0], '', $input); } - if (preg_match_all('/[!-]author:(?P[\w+]*)/', $input, $matches)) { + if (preg_match_all('/[!-]author:(?P[^\s"]*)/', $input, $matches)) { $this->not_author = array_merge($this->not_author ? $this->not_author : array(), $matches['search']); $input = str_replace($matches[0], '', $input); } -- cgit v1.2.3