From 128f66c9b12a4df2c8b9bff305cf4615da715870 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 30 Apr 2012 05:02:00 +0200 Subject: [PATCH] Fix mimetype checking. Close #400 Conflicts: 4chan_x.user.js script.coffee --- 4chan_x.user.js | 2 +- changelog | 1 + script.coffee | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 7b2a01f44..f18158fa6 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1841,7 +1841,7 @@ }); ta.style.cssText = $.get('QR.size', ''); } - mimeTypes = $('.rules').firstChild.textContent.match(/: (.+) /)[1].toLowerCase().replace(/\w+/g, function(type) { + mimeTypes = $('.rules').firstElementChild.textContent.match(/: (.+)/)[1].toLowerCase().replace(/\w+/g, function(type) { switch (type) { case 'jpg': return 'image/jpeg'; diff --git a/changelog b/changelog index f8413bbd0..01f9474ed 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - Mayhem Auto-GIF will not run in /gif/. + Fix QR filetype checking. 2.29.3 - Mayhem diff --git a/script.coffee b/script.coffee index 8e930ed96..0b0e49333 100644 --- a/script.coffee +++ b/script.coffee @@ -1405,7 +1405,7 @@ QR = ta.style.cssText = $.get 'QR.size', '' # Allow only this board's supported files. - mimeTypes = $('.rules').firstChild.textContent.match(/: (.+) /)[1].toLowerCase().replace /\w+/g, (type) -> + mimeTypes = $('.rules').firstElementChild.textContent.match(/: (.+)/)[1].toLowerCase().replace /\w+/g, (type) -> switch type when 'jpg' 'image/jpeg'