mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
chore: add scheme validation
This commit is contained in:
parent
ef2dfb6cca
commit
bb9a271fa8
1 changed files with 5 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue