diff options
| author | 2018-09-16 10:46:27 +0200 | |
|---|---|---|
| committer | 2018-09-16 10:46:27 +0200 | |
| commit | b323ed084620cac2222fe1c93ec05b9773eb81e6 (patch) | |
| tree | ec1057810fd3a1971f99d1ebb60b936e0c543094 /app/Models/Search.php | |
| parent | 9fa2122d4a27de7d9a207cea3dee911541b63420 (diff) | |
Improve authors (#2025)
* 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 <em> styling
* Final details
* Minor spacing
Diffstat (limited to 'app/Models/Search.php')
| -rw-r--r-- | app/Models/Search.php | 8 |
1 files changed, 4 insertions, 4 deletions
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<search>[\w+]*)/', $input, $matches)) { + if (preg_match_all('/\bintitle:(?P<search>[^\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<search>[\w+]*)/', $input, $matches)) { + if (preg_match_all('/[!-]intitle:(?P<search>[^\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<search>[\w+]*)/', $input, $matches)) { + if (preg_match_all('/\bauthor:(?P<search>[^\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<search>[\w+]*)/', $input, $matches)) { + if (preg_match_all('/[!-]author:(?P<search>[^\s"]*)/', $input, $matches)) { $this->not_author = array_merge($this->not_author ? $this->not_author : array(), $matches['search']); $input = str_replace($matches[0], '', $input); } |
