Fix UUID generation and message for success in icon marketplace upload

This commit is contained in:
2025-08-24 21:55:53 -07:00
parent b80be97f18
commit a503506f3b
2 changed files with 9 additions and 5 deletions

View File

@@ -1,11 +1,8 @@
<?php
require __DIR__ . '/../incl/util.php';
require __DIR__ . '/../../../../vendor/autoload.php';
setPlainHeader();
checkClientDatabaseVersion();
use Ramsey\Uuid\Uuid;
$post = getPostData();
$token = $post['token'] ?? '';
$username = $post['username'] ?? '';
@@ -47,7 +44,7 @@ if ($result->fetch_assoc()) {
}
$stmt->close();
$uuid = Uuid::uuid4()->toString();
$uuid = uuidv4();
$stmt = $conn->prepare("INSERT INTO marketplaceicons (uuid, userId, data, hash, price, name, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("sissisi", $uuid, $id, $filecontent, $hash, $price, $name, $time);
@@ -55,6 +52,6 @@ $stmt->execute();
$insertId = $conn->insert_id;
$stmt->close();
echo encrypt(json_encode(["success" => true]));
echo encrypt(json_encode(["success" => true, "message" => "Icon uploaded successfully! It will be reviewed and accepted or denied soon"]));
$conn->close();