git.cweiske.de
/
stouyapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3771acf
)
Prevent E_NOTICE when game parameter is missing in queue cleanup
author
Christian Weiske
<cweiske@cweiske.de>
Fri, 13 Oct 2023 15:40:48 +0000
(17:40 +0200)
committer
Christian Weiske
<cweiske@cweiske.de>
Fri, 13 Oct 2023 15:40:48 +0000
(17:40 +0200)
Resolves: https://github.com/cweiske/stouyapi/issues/4
www/api/v1/queued_downloads_delete.php
patch
|
blob
|
history
diff --git
a/www/api/v1/queued_downloads_delete.php
b/www/api/v1/queued_downloads_delete.php
index 6517adca2be082884f758a4f6585218d09961216..a044053502ef49d6793275a273e1c231122d5f22 100644
(file)
--- a/
www/api/v1/queued_downloads_delete.php
+++ b/
www/api/v1/queued_downloads_delete.php
@@
-20,6
+20,13
@@
if ($ip == '') {
}
$ip = mapIp($ip);
+if (!isset($_GET['game'])) {
+ header('HTTP/1.0 400 Bad Request');
+ header('Content-type: text/plain');
+ echo 'Game parameter missing' . "\n";
+ exit(1);
+}
+
$game = $_GET['game'];
$cleanGame = preg_replace('#[^a-zA-Z0-9._]#', '', $game);
if ($game != $cleanGame || $game == '') {