3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-24 04:49:25 +01:00

fix security bug in imgur module

This commit is contained in:
reality 2015-02-27 09:49:46 +00:00
parent 3d8700a6d2
commit 2f874686b6

View File

@ -197,7 +197,7 @@ var imgur = function(dbot) {
var postImage = function(link, imgData) {
var info = this.internalAPI.infoString(imgData);
event.reply(this.config.outputPrefix + ' ' + local + ': ' + link + ' [' + info + ']');
event.reply('['+this.config.outputPrefix + '] ' + local + ': ' + link + ' [' + info + ']');
}.bind(this);
var newCacheImage = function(link, imgData) {
this.riCache.push([link, imgData]);
@ -222,7 +222,7 @@ var imgur = function(dbot) {
this.api.getRandomImage(function(link, slug) {
this.api.getImageInfo(slug, function(imgData) {
var info = this.internalAPI.infoString(imgData);
event.reply(this.config.outputPrefix + ' ' + local + ': ' + link + ' [' + info + ']');
event.reply('['+this.config.outputPrefix + '] ' + local + ': ' + link + ' [' + info + ']');
}.bind(this));
}.bind(this));
},
@ -243,7 +243,7 @@ var imgur = function(dbot) {
if(!_.isUndefined(body) && body.data && body.data[0] != undefined) {
var num = _.random(0, body.data.length - 1);
this.api.getGalleryInfo(body.data[num].id, function(gal) {
event.reply(this.config.outputPrefix + ' ' + local + ': ' + gal.data.link + ' [' +
event.reply('['+this.config.outputPrefix + '] ' + local + ': ' + gal.data.link + ' [' +
this.internalAPI.galleryInfoString(gal) + ']');
}.bind(this));
}