From 267ca3cfb5ef88ca7dd8ce4927d8f337966e47d8 Mon Sep 17 00:00:00 2001 From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com> Date: Sat, 19 Jul 2025 16:04:01 +0530 Subject: [PATCH] Update src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../Platform/Modules/Proxy/Http/Rules/API/Create.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php index 0ab50892be..9d7aca5b43 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php @@ -106,9 +106,9 @@ class Create extends Action throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); } - if (\str_ends_with($domain, '.appwrite.network')) { - $subdomain = \str_replace('.appwrite.network', '', $domain); - if (\str_contains($subdomain, '.')) { + if (\str_ends_with(\strtolower($domain), '.appwrite.network')) { + $subdomain = \str_replace('.appwrite.network', '', \strtolower($domain)); + if (empty($subdomain) || \str_contains($subdomain, '.')) { throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Sub-subdomains are not allowed for appwrite.network. Only one level of subdomain is permitted.'); } }