summaryrefslogtreecommitdiff
path: root/public/emotes/upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/emotes/upload.php')
-rw-r--r--public/emotes/upload.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/public/emotes/upload.php b/public/emotes/upload.php
index e4ff6cc..4506152 100644
--- a/public/emotes/upload.php
+++ b/public/emotes/upload.php
@@ -2,6 +2,7 @@
include "../../src/accounts.php";
include_once "../../src/config.php";
include_once "../../src/alert.php";
+include_once "../../src/captcha.php";
if (!EMOTE_UPLOAD) {
generate_alert("/404.php", "Emote upload is disabled", 403);
@@ -135,6 +136,12 @@ if ($_SERVER['REQUEST_METHOD'] != "POST") {
</div>
</section>
+ <?php
+ if (CAPTCHA_ENABLE && (CAPTCHA_FORCE_USERS || !isset($_SESSION["user_id"]))) {
+ html_captcha_form();
+ }
+ ?>
+
<section class="box column" id="emote-showcase" style="display: none;">
<div class="emote-showcase">
<div class="emote-image">
@@ -319,6 +326,11 @@ if ($_SERVER['REQUEST_METHOD'] != "POST") {
exit;
}
+if (!CLIENT_REQUIRES_JSON && CAPTCHA_ENABLE && !isset($_SESSION["captcha_solved"])) {
+ generate_alert("/404.php", "You haven't solved captcha yet.", 403);
+ exit;
+}
+
$is_manual = intval($_POST["manual"] ?? "0") == 1;
if ($is_manual && !isset($_FILES["file-1x"], $_FILES["file-2x"], $_FILES["file-3x"])) {