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.'); } }