Fix handling of quotes in queries
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -37,7 +37,7 @@ class AQueryParameter {
|
|||||||
|
|
||||||
public function getValue() {
|
public function getValue() {
|
||||||
if (is_string($this->value) && mb_strlen($this->value) > 1) {
|
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 $param;
|
||||||
}
|
}
|
||||||
return $this->value;
|
return $this->value;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default {
|
|||||||
|
|
||||||
const filterOutQuotes = (q) => {
|
const filterOutQuotes = (q) => {
|
||||||
if (q[0] === '"' && q[q.length - 1] === '"') {
|
if (q[0] === '"' && q[q.length - 1] === '"') {
|
||||||
return q.substr(1, -1)
|
return q.substr(1, q.length - 2)
|
||||||
}
|
}
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user