unserialize html encoding in redirect urls
This commit is contained in:
parent
e2ae925b97
commit
f7617ec06e
2 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@ let lists = require('./lists');
|
||||||
|
|
||||||
let log = require('npmlog');
|
let log = require('npmlog');
|
||||||
let urllib = require('url');
|
let urllib = require('url');
|
||||||
|
let he = require('he');
|
||||||
|
|
||||||
module.exports.resolve = (campaignCid, linkCid, callback) => {
|
module.exports.resolve = (campaignCid, linkCid, callback) => {
|
||||||
campaigns.getByCid(campaignCid, (err, campaign) => {
|
campaigns.getByCid(campaignCid, (err, campaign) => {
|
||||||
|
@ -295,7 +296,9 @@ module.exports.updateLinks = (campaign, list, subscription, serviceUrl, message,
|
||||||
return replaceUrls();
|
return replaceUrls();
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.add(urlItem.value, campaign.id, (err, linkId, cid) => {
|
module.exports.add(he.decode(urlItem.value, {
|
||||||
|
isAttributeValue: true
|
||||||
|
}), campaign.id, (err, linkId, cid) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
log.error('Link', err.stack);
|
log.error('Link', err.stack);
|
||||||
return storeNext();
|
return storeNext();
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
"geoip-ultralight": "^0.1.3",
|
"geoip-ultralight": "^0.1.3",
|
||||||
"handlebars": "^4.0.5",
|
"handlebars": "^4.0.5",
|
||||||
"hbs": "^4.0.0",
|
"hbs": "^4.0.0",
|
||||||
|
"he": "^1.1.0",
|
||||||
"html-to-text": "^2.1.0",
|
"html-to-text": "^2.1.0",
|
||||||
"humanize": "0.0.9",
|
"humanize": "0.0.9",
|
||||||
"is-url": "^1.2.1",
|
"is-url": "^1.2.1",
|
||||||
|
|
Loading…
Reference in a new issue