diff --git a/src/Appwrite/Network/Platform.php b/src/Appwrite/Network/Platform.php index cc59bd4508..6b18b35bef 100644 --- a/src/Appwrite/Network/Platform.php +++ b/src/Appwrite/Network/Platform.php @@ -50,10 +50,10 @@ class Platform /** * Get user-friendly platform name from a scheme. * - * @param string $scheme + * @param string|null $scheme * @return string Empty string if scheme is not found. */ - public static function getNameByScheme(string $scheme): string + public static function getNameByScheme(?string $scheme): string { return self::$names[$scheme] ?? ''; } @@ -62,7 +62,7 @@ class Platform { $hostnames = []; foreach ($platforms as $platform) { - $type = $platform['type'] ?? self::TYPE_UNKNOWN; + $type = strtolower($platform['type'] ?? self::TYPE_UNKNOWN); $hostname = strtolower($platform['hostname'] ?? ''); $key = strtolower($platform['key'] ?? ''); diff --git a/src/Appwrite/Network/Validator/Redirect.php b/src/Appwrite/Network/Validator/Redirect.php index 43750f4cbd..162f4c7eb9 100644 --- a/src/Appwrite/Network/Validator/Redirect.php +++ b/src/Appwrite/Network/Validator/Redirect.php @@ -12,7 +12,7 @@ class Redirect extends Origin */ public function getDescription(): string { - $platform = $this->scheme ? Platform::getNameByScheme($this->scheme) : null; + $platform = Platform::getNameByScheme($this->scheme); $host = $this->host ? '(' . $this->host . ')' : ''; if (empty($this->host) && empty($this->scheme)) {