diff options
| -rw-r--r-- | static/js/invalid_domains.js | 63 | ||||
| -rw-r--r-- | static/js/pichat.js | 22 |
2 files changed, 85 insertions, 0 deletions
diff --git a/static/js/invalid_domains.js b/static/js/invalid_domains.js new file mode 100644 index 0000000..67f6a8f --- /dev/null +++ b/static/js/invalid_domains.js @@ -0,0 +1,63 @@ +var InvalidDomains = [ + "http://13gb.com", + "http://69.42.73.10", + "http://amitkulkarni.info", + "http://catcatcat.com", + "http://celebskin.com", + "http://current.com", + "http://files.shroomery.org", + "http://guides.macrumors.com", + "http://henshin.250x.com", + "http://i.pbase.com", + "http://images.nintendolife.com", + "http://img.bettersoft.de", + "http://izismile.com", + "http://izismile.com", + "http://izismile.com/img", + "http://mytextgraphics.com", + "http://nexus404.com", + "http://nintendolife.com", + "http://nofatclips.com", + "http://portfolio.deeperstudy.com", + "http://ru.fishki.net", + "http://ski.far.ru", + "http://tripod.com", + "http://uallknow.com", + "http://victoryaworld.com", + "http://images.4chan.org", + "http://www.4chan.org", + "http://www.angelfire.com", + "http://www.animation-central.com", + "http://www.arrested.com", + "http://www.b3tards.com", + "http://www.bloody-disgusting.com", + "http://www.commenthaven.com", + "http://www.coolnotions.com", + "http://www.creepygif.com", + "http://www.dailymakeover.com", + "http://www.fortunecity.com", + "http://www.gifbin.com", + "http://www.goatse.fr", + "http://www.hail-to-the-thief.org", + "http://www.knowledgebase-script.com", + "http://www.markagame.ru", + "http://www.masternewmedia.org", + "http://www.mortalkombatonline.com", + "http://www.mymodernmagic.com", + "http://www.mystkittsdivebuddy.com", + "http://www.nudecelebritieshentai.com", + "http://www.oldtimestrongman.com", + "http://www.popularpages.net", + "http://www.retrojunk.com", + "http://www.schm032.com", + "http://www.sevenoaksart.co.uk", + "http://www.suicidekiss.com", + "http://www.thecinemasource.com", + "http://www.veryboy.fr", + "http://www.vintagecomputing.com", + "http://www.virtuallandmedia.com", + "http://www.whudat.com", + "http://www.willrich.supanet.com", + "http://www.ysmarko.com", + "http://xxxspacegirls.us" +];
\ No newline at end of file diff --git a/static/js/pichat.js b/static/js/pichat.js index d8f71c6..658578a 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -229,8 +229,30 @@ function handleMsgError(resp) { // Messages +function invalidImageDomain(content) { + var words = content.toLowerCase().split(' '); + for (var i = 0; i < words.length; i++) { + var w = words[i]; + if (PicRegex.test(w)) { + for (var j = 0; j < InvalidDomains.length; j++) { + var d = InvalidDomains[j]; + if (w.indexOf(d) != -1) { + return d; + } + } + } + } +} + function submitMessage() { var content = $.trim($('#msgInput').val()); + + var invalidDomain = invalidImageDomain(content); + if (invalidDomain) { + alert("Sorry, cannot accept images from " + invalidDomain + ". Maybe host the image elsewhere?") + return; + } + $('#msgInput').val(''); if (content == '') { return; } if (content.length > 1337) { |
