From 753aebccab238bcb9004b69e41ecf05f0b4dedc0 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 15 Aug 2022 19:31:14 +0000 Subject: [PATCH] Create Appwrite Query Validator The Appwrite Query Validator checks if the cursor value is a valid UID. This is different than the cursor value in utopia-php/database because the value in the database layer is expected to be a document. --- .../Utopia/Database/Validator/Query.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/Appwrite/Utopia/Database/Validator/Query.php diff --git a/src/Appwrite/Utopia/Database/Validator/Query.php b/src/Appwrite/Utopia/Database/Validator/Query.php new file mode 100644 index 0000000000..eeb5b51a76 --- /dev/null +++ b/src/Appwrite/Utopia/Database/Validator/Query.php @@ -0,0 +1,21 @@ +isValid($cursor)) { + return true; + } + + $this->message = 'Invalid cursor: ' . $validator->getDescription(); + return false; + } +}