Update src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Harsh Mahajan
2025-07-19 16:04:01 +05:30
committed by GitHub
co-authored by coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent 70470f7e2a
commit 267ca3cfb5
@@ -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.');
}
}