From 388cde2411cbd4b56baa0da1e0f08abe85fa848d Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 2 May 2020 07:14:16 +0700 Subject: [PATCH] Fix postgresql create on call is_unique via API --- system/Validation/Rules.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/Validation/Rules.php b/system/Validation/Rules.php index 371634b40da8..9d02227259c5 100644 --- a/system/Validation/Rules.php +++ b/system/Validation/Rules.php @@ -228,7 +228,11 @@ public function is_unique(string $str = null, string $field, array $data): bool if (! empty($ignoreField) && ! empty($ignoreValue)) { - $row = $row->where("{$ignoreField} !=", $ignoreValue); + preg_match('/(?:{)(.*)(?:})/', $ignoreValue, $matches); + if (! $matches) + { + $row = $row->where("{$ignoreField} !=", $ignoreValue); + } } return (bool) ($row->get()