diff --git a/4chan_x.user.js b/4chan_x.user.js index c133f236c..451c587d4 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1364,7 +1364,7 @@ } }, dialog: function(text) { - var l, qr, ta; + var c, l, m, qr, ta; if (text == null) { text = ''; } @@ -1372,6 +1372,10 @@ top: '0', left: '0' }, " X
Quick Reply
" + QR.spoiler + "
" + ($.get('captchas', []).length) + " captchas
attach another file
"); + c = d.cookie; + $('[name=name]', el).value = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; + $('[name=email]', el).value = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; + $('[name=pwd]', el).value = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value; if (conf['Cooldown']) { QR.cooldown; } diff --git a/script.coffee b/script.coffee index d175babc1..e941d52b7 100644 --- a/script.coffee +++ b/script.coffee @@ -1077,6 +1077,11 @@ QR =
attach another file
" + #XXX use dom methods to set values instead of injecting raw user input into your html -_-; + c = d.cookie + $('[name=name]', el).value = if m = c.match(/4chan_name=([^;]+)/) then decodeURIComponent m[1] else '' + $('[name=email]', el).value = if m = c.match(/4chan_email=([^;]+)/) then decodeURIComponent m[1] else '' + $('[name=pwd]', el).value = if m = c.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value QR.cooldown if conf['Cooldown'] $.bind $('.close', qr), 'click', QR.close $.bind $('form', qr), 'submit', QR.submit