From 3a1373930c0f4ff68360123fb5c8a2de1baaea91 Mon Sep 17 00:00:00 2001 From: Bui Date: Thu, 26 Feb 2015 18:39:16 +0900 Subject: [PATCH] resolve #402 clear the file field if a tor user tried to upload. even though most tor users disable JS... --- js/ajax.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/ajax.js b/js/ajax.js index 43b88934..11fac152 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -73,6 +73,10 @@ $(window).ready(function() { alert(post_response.error); $(form).find('input[type="submit"]').val(submit_txt); $(form).find('input[type="submit"]').removeAttr('disabled'); + + if (post_response.error == 'Sorry. Tor users can\'t upload files.') { + $(form).find('input[name="file_url"],input[type="file"]').val('').change(); + } } } else if (post_response.redirect && post_response.id) { if (!$(form).find('input[name="thread"]').length