1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 09:54:17 +02:00

remove folders from demo names

This commit is contained in:
Robin Appelman 2022-05-18 13:29:48 +02:00
commit 86ffe80044

View file

@ -47,6 +47,9 @@ class UploadProvider extends BaseProvider {
}
public function upload(string $key, string $red, string $blu, string $name, string $demoFile): string {
$nameParts = explode('/', $name);
$name = array_pop($nameParts);
$user = $this->userProvider->byKey($key);
if (!$user || ('' !== $this->uploadKey && $this->uploadKey !== $key)) {
throw new InvalidKeyException('Invalid key');