diff --git a/sections/ajax/index.php b/sections/ajax/index.php index 0f485d985..6172972b4 100644 --- a/sections/ajax/index.php +++ b/sections/ajax/index.php @@ -62,7 +62,7 @@ $Action = $_GET['action'] ?? ''; if (isset($Aliases[$action])) { - $Action = $Aliases[$action]; + $_GET['action'] = $Action = $Aliases[$action]; } if (!$Action) { json_die("failure"); diff --git a/sections/requests/take_fill.php b/sections/requests/take_fill.php index 96e4ef1fd..465a8d426 100644 --- a/sections/requests/take_fill.php +++ b/sections/requests/take_fill.php @@ -218,13 +218,18 @@ function search_joined_string($Haystack, $Needle, $Separator = '|', $Strict = tr $SphQL->raw_query("UPDATE requests, requests_delta SET torrentid = $TorrentID, fillerid = $FillerID WHERE id = $RequestID", false); if (defined('AJAX')) { - return [ + $data = [ 'requestId' => $RequestID, 'torrentId' => $TorrentID, 'fillerId' => $FillerID, 'fillerName' => $FillerUsername, 'bounty' => $RequestVotes['TotalBounty'], ]; + if ($_GET['action'] === 'request_fill') { + json_print('success', $data); + } else { + return $data; + } } else { header("Location: requests.php?action=view&id=$RequestID"); }