From 85ad3f8043c331ae756f2c91cf67dac9fe946bf3 Mon Sep 17 00:00:00 2001 From: Kevin Borchers Date: Thu, 3 Jan 2019 06:01:33 -0700 Subject: [PATCH] Update Setting.php to allow UUID Provides a test to see if the ID is a number, otherwise escapes the query. --- src/Setting.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Setting.php b/src/Setting.php index c2d37a7..9cd7816 100644 --- a/src/Setting.php +++ b/src/Setting.php @@ -263,7 +263,8 @@ protected function getConstraintValue($constraint_value) */ protected function getConstraintQuery($constraint_value) { - return $this->custom_constraint ?: $this->constraint_key . ' = ' . $constraint_value; + $theValue = is_numeric($constraint_value) ? $constraint_value : "'$constraint_value'"; + return $this->custom_constraint ?: "$this->constraint_key = $theValue"; } }