Skip to content

Commit

Permalink
index.php/builds: set loadertype on update
Browse files Browse the repository at this point in the history
  • Loading branch information
cowpod committed Oct 29, 2024
1 parent d476f3a commit 18c02a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,8 @@ function uri($uri) {
unset($modslist[0]);
}

// update build details
// todo: move this to it's own function and set form action to that.
if (isset($_POST['java'])) {
if ($_POST['forgec']!=="none"||empty($modslist)) {
if ($_POST['forgec']=="wipe"||empty($modslist)) {
Expand All @@ -1188,7 +1190,9 @@ function uri($uri) {
assert(sizeof($minecraft)==1);
$minecraft=$minecraft[0];
}
$db->execute("UPDATE `builds` SET `minecraft` = '".$minecraft['mcversion']."', `java` = '".$db->sanitize($_POST['java'])."', `memory` = '".$db->sanitize($_POST['memory'])."', `public` = ".$ispublic." WHERE `id` = ".$db->sanitize($_GET['id']));

$db->execute("UPDATE `builds` SET `minecraft` = '".$minecraft['mcversion']."', `java` = '".$db->sanitize($_POST['java'])."', `memory` = '".$db->sanitize($_POST['memory'])."', `public` = ".$ispublic.", `loadertype` = '".$minecraft['loadertype']."' WHERE `id` = ".$db->sanitize($_GET['id']));

$latest_public = $db->query("SELECT `name`,`modpack`,`public` FROM `builds` WHERE `public` = 1 AND `modpack` = ".$user['modpack']." ORDER BY `id` DESC");
if ($latest_public) {
assert(sizeof($latest_public==1));
Expand Down

0 comments on commit 18c02a6

Please sign in to comment.