From bb9a271fa85045af287283c107b1ba922ba0069e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 3 Jul 2025 16:38:22 +0530 Subject: [PATCH] chore: add scheme validation --- src/Appwrite/Network/Platform.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Network/Platform.php b/src/Appwrite/Network/Platform.php index 6b18b35bef..b7acafc96d 100644 --- a/src/Appwrite/Network/Platform.php +++ b/src/Appwrite/Network/Platform.php @@ -101,12 +101,14 @@ class Platform { $schemes = []; foreach ($platforms as $platform) { - $type = $platform['type'] ?? self::TYPE_UNKNOWN; - $scheme = $platform['key'] ?? ''; + $type = strtolower($platform['type'] ?? self::TYPE_UNKNOWN); + $scheme = strtolower($platform['key'] ?? ''); switch ($type) { case self::TYPE_SCHEME: - $schemes[] = $scheme; + if (!empty($scheme) && preg_match('/^[a-z][a-z0-9+.-]*$/', $scheme)) { + $schemes[] = $scheme; + } break; default: break;