From eda4a5145dbc80b2e612dc8674c99c7100cea0b6 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 27 Nov 2015 22:26:03 -0800 Subject: [PATCH] Input type=file should not have a max attribute. --- src/Posting/QR.coffee | 4 ++-- src/Posting/QR.post.coffee | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 75b9d91a4..d590b8d8e 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -494,10 +494,10 @@ QR = QR.max_width = +match_max?[1] or 10000 QR.max_height = +match_max?[2] or 10000 - nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]')?.value or '0' + QR.max_size = +($('input[name=MAX_FILE_SIZE]')?.value or '0') scriptData = Get.scriptData() - QR.max_size_video = if (m = scriptData.match /\bmaxWebmFilesize *= *(\d+)\b/) then +m[1] else +nodes.fileInput.max + QR.max_size_video = if (m = scriptData.match /\bmaxWebmFilesize *= *(\d+)\b/) then +m[1] else QR.max_size QR.max_comment = if (m = scriptData.match /\bcomlen *= *(\d+)\b/) then +m[1] else 2000 QR.max_width_video = QR.max_height_video = 2048 diff --git a/src/Posting/QR.post.coffee b/src/Posting/QR.post.coffee index 6e1552b54..7d1bcb49f 100644 --- a/src/Posting/QR.post.coffee +++ b/src/Posting/QR.post.coffee @@ -202,7 +202,7 @@ QR.post = class @readFile() checkSize: -> - max = QR.nodes.fileInput.max + max = QR.max_size max = Math.min(max, QR.max_size_video) if /^video\//.test @file.type if @file.size > max @fileError "File too large (file: #{@filesize}, max: #{$.bytesToString max})."