diff --git a/database/uploadMarketplaceIcon.php b/database/uploadMarketplaceIcon.php index 0207621..b0b9079 100644 --- a/database/uploadMarketplaceIcon.php +++ b/database/uploadMarketplaceIcon.php @@ -1,11 +1,8 @@ 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(); \ No newline at end of file diff --git a/incl/util.php b/incl/util.php index 00780f7..f16213b 100644 --- a/incl/util.php +++ b/incl/util.php @@ -92,4 +92,11 @@ function getPostData() { $decrypted[$decKey] = $decValue; } return $decrypted; +} + +function uuidv4() { + $data = random_bytes(16); + $data[6] = chr((ord($data[6]) & 0x0f) | 0x40); + $data[8] = chr((ord($data[8]) & 0x3f) | 0x80); + return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); } \ No newline at end of file