mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-24 04:41:01 +00:00
Fix #2560
This commit is contained in:
@@ -121,11 +121,11 @@ class Search implements SearchInterface
|
|||||||
*/
|
*/
|
||||||
public function parseQuery(string $query): void
|
public function parseQuery(string $query): void
|
||||||
{
|
{
|
||||||
$filteredQuery = $query;
|
$filteredQuery = app('steam')->cleanString($query);
|
||||||
$this->originalQuery = $query;
|
$this->originalQuery = $filteredQuery;
|
||||||
$pattern = '/[a-z_]*:[0-9a-z-.]*/i';
|
$pattern = '/[[:alpha:]_]*:"?[\p{L}_-]*"?/ui';
|
||||||
$matches = [];
|
$matches = [];
|
||||||
preg_match_all($pattern, $query, $matches);
|
preg_match_all($pattern, $filteredQuery, $matches);
|
||||||
|
|
||||||
foreach ($matches[0] as $match) {
|
foreach ($matches[0] as $match) {
|
||||||
$this->extractModifier($match);
|
$this->extractModifier($match);
|
||||||
@@ -314,6 +314,7 @@ class Search implements SearchInterface
|
|||||||
if (2 === count($parts) && '' !== trim((string)$parts[1]) && '' !== trim((string)$parts[0])) {
|
if (2 === count($parts) && '' !== trim((string)$parts[1]) && '' !== trim((string)$parts[0])) {
|
||||||
$type = trim((string)$parts[0]);
|
$type = trim((string)$parts[0]);
|
||||||
$value = trim((string)$parts[1]);
|
$value = trim((string)$parts[1]);
|
||||||
|
$value = trim(trim($value, '"\''));
|
||||||
if (in_array($type, $this->validModifiers, true)) {
|
if (in_array($type, $this->validModifiers, true)) {
|
||||||
// filter for valid type
|
// filter for valid type
|
||||||
$this->modifiers->push(['type' => $type, 'value' => $value]);
|
$this->modifiers->push(['type' => $type, 'value' => $value]);
|
||||||
|
|||||||
Reference in New Issue
Block a user