Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added checks to prevent infinite ARK value minting #42

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ function onChangeTerms(value)
</div>
<div class="col-sm-7">
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST" && !empty($_POST['mint-number'])) {
if ($_SERVER["REQUEST_METHOD"] == "POST" && !empty($_POST['mint-number']) && $_POST['mint-number'] > 0) {

// backup database before bulk binding
Database::backupArkDatabase();
Expand All @@ -1070,12 +1070,19 @@ function onChangeTerms(value)
<div class="alert alert-success" role="alert">
Ark IDs have been minted successfully.
</div>
';
';
Database::dbclose($noid);
// redirect to the page.
header("Location: admin.php?db=" . $_GET["db"]);

}
else if ($_SERVER["REQUEST_METHOD"] == "POST" && (empty($_POST['mint-number']) || $_POST['mint-number'] <= 0)) {
print '
<div class="alert alert-warning" role="alert">
Please enter a valid number to mint.
</div>
';
}
?>
<p><h5>Minted Arks </h5></p>
<div class="row">
Expand Down