From cf4be828275f8b3f87009141a931602b75d75eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 21 Apr 2021 11:54:03 +0200 Subject: [PATCH] Fix handling of quotes in queries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Search/Query/AQueryParameter.php | 2 +- src/store/card.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Search/Query/AQueryParameter.php b/lib/Search/Query/AQueryParameter.php index 00f3838a2..aceeb3486 100644 --- a/lib/Search/Query/AQueryParameter.php +++ b/lib/Search/Query/AQueryParameter.php @@ -37,7 +37,7 @@ class AQueryParameter { public function getValue() { if (is_string($this->value) && mb_strlen($this->value) > 1) { - $param = ($this->value[0] === '"' && $this->value[mb_strlen($this->value) - 1] === '"') ? mb_substr($this->value, 1, -1): $this->value; + $param = (mb_substr($this->value, 0, 1) === '"' && mb_substr($this->value, -1, 1) === '"') ? mb_substr($this->value, 1, -1): $this->value; return $param; } return $this->value; diff --git a/src/store/card.js b/src/store/card.js index bc3238dc3..30c54b52d 100644 --- a/src/store/card.js +++ b/src/store/card.js @@ -92,7 +92,7 @@ export default { const filterOutQuotes = (q) => { if (q[0] === '"' && q[q.length - 1] === '"') { - return q.substr(1, -1) + return q.substr(1, q.length - 2) } return q }