diff --git a/app/init.php b/app/init.php index 9c7166c1e6..2d1aae9de8 100644 --- a/app/init.php +++ b/app/init.php @@ -1232,7 +1232,7 @@ App::setResource('schemes', function (array $platforms) { Origin::CLIENT_TYPE_FLUTTER_REACT_NATIVE_IOS, Origin::CLIENT_TYPE_FLUTTER_REACT_NATIVE_ANDROID ])) { - schemes[] = $platform['scheme']; + $schemes[] = $platform['scheme']; } } diff --git a/src/Appwrite/Network/Validator/Redirect.php b/src/Appwrite/Network/Validator/Redirect.php index 1b019d4201..05482f1072 100644 --- a/src/Appwrite/Network/Validator/Redirect.php +++ b/src/Appwrite/Network/Validator/Redirect.php @@ -48,9 +48,10 @@ class Redirect extends Host { // `parse_url` returns false for URL with only a scheme // We need to handle parsing the scheme manually - if (preg_match('/^([a-z][a-z0-9+\.-]*):\/+$/i', $value, $matches)) { - $scheme = strtolower($matches[1]); + if (!preg_match('/^([a-z][a-z0-9+\.-]*):\/+$/i', $value, $matches)) { + return false; } + $scheme = strtolower($matches[1]); // If the scheme is not http or https, check the hostname if (\in_array($scheme, ["http", "https"])) {