allow using only text content
This commit is contained in:
parent
3afb37e169
commit
59c7e1dd8b
3 changed files with 38 additions and 22 deletions
|
@ -631,13 +631,14 @@ module.exports.create = (campaign, opts, callback) => {
|
||||||
tools.prepareHtml(campaign.html, (err, preparedHtml) => {
|
tools.prepareHtml(campaign.html, (err, preparedHtml) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
log.error('jsdom', err);
|
log.error('jsdom', err);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!preparedHtml) {
|
||||||
preparedHtml = campaign.html;
|
preparedHtml = campaign.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preparedHtml) {
|
keys.push('html_prepared');
|
||||||
keys.push('html_prepared');
|
values.push(preparedHtml);
|
||||||
values.push(preparedHtml);
|
|
||||||
}
|
|
||||||
|
|
||||||
db.getConnection((err, connection) => {
|
db.getConnection((err, connection) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -796,13 +797,14 @@ module.exports.update = (id, updates, callback) => {
|
||||||
tools.prepareHtml(campaign.html, (err, preparedHtml) => {
|
tools.prepareHtml(campaign.html, (err, preparedHtml) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
log.error('jsdom', err);
|
log.error('jsdom', err);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!preparedHtml) {
|
||||||
preparedHtml = campaign.html;
|
preparedHtml = campaign.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preparedHtml) {
|
keys.push('html_prepared');
|
||||||
keys.push('html_prepared');
|
values.push(preparedHtml);
|
||||||
values.push(preparedHtml);
|
|
||||||
}
|
|
||||||
|
|
||||||
db.getConnection((err, connection) => {
|
db.getConnection((err, connection) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
28
package.json
28
package.json
|
@ -30,7 +30,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bcrypt-nodejs": "0.0.3",
|
"bcrypt-nodejs": "0.0.3",
|
||||||
"body-parser": "^1.15.2",
|
"body-parser": "^1.16.0",
|
||||||
"bounce-handler": "^7.3.2-fork.2",
|
"bounce-handler": "^7.3.2-fork.2",
|
||||||
"compression": "^1.6.2",
|
"compression": "^1.6.2",
|
||||||
"config": "^1.24.0",
|
"config": "^1.24.0",
|
||||||
|
@ -39,42 +39,42 @@
|
||||||
"cookie-parser": "^1.4.3",
|
"cookie-parser": "^1.4.3",
|
||||||
"csurf": "^1.9.0",
|
"csurf": "^1.9.0",
|
||||||
"csv-generate": "^1.0.0",
|
"csv-generate": "^1.0.0",
|
||||||
"csv-parse": "^1.1.7",
|
"csv-parse": "^1.2.0",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"express": "^4.14.0",
|
"express": "^4.14.1",
|
||||||
"express-session": "^1.14.2",
|
"express-session": "^1.15.0",
|
||||||
"faker": "^3.1.0",
|
"faker": "^3.1.0",
|
||||||
"feedparser": "^1.1.5",
|
"feedparser": "^2.1.0",
|
||||||
"geoip-ultralight": "^0.1.4",
|
"geoip-ultralight": "^0.1.4",
|
||||||
"handlebars": "^4.0.6",
|
"handlebars": "^4.0.6",
|
||||||
"hbs": "^4.0.1",
|
"hbs": "^4.0.1",
|
||||||
"he": "^1.1.0",
|
"he": "^1.1.1",
|
||||||
"html-to-text": "^3.0.0",
|
"html-to-text": "^3.0.0",
|
||||||
"humanize": "0.0.9",
|
"humanize": "0.0.9",
|
||||||
"is-url": "^1.2.2",
|
"is-url": "^1.2.2",
|
||||||
"isemail": "^2.2.1",
|
"isemail": "^2.2.1",
|
||||||
"jsdom": "^9.9.1",
|
"jsdom": "^9.9.1",
|
||||||
"juice": "^4.0.2",
|
"juice": "^4.0.2",
|
||||||
"libmime": "^3.0.0",
|
"libmime": "^3.1.0",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"moment-timezone": "^0.5.11",
|
"moment-timezone": "^0.5.11",
|
||||||
"morgan": "^1.7.0",
|
"morgan": "^1.7.0",
|
||||||
"multer": "^1.2.1",
|
"multer": "^1.3.0",
|
||||||
"mysql": "^2.12.0",
|
"mysql": "^2.13.0",
|
||||||
"nodemailer": "^2.7.0",
|
"nodemailer": "^2.7.2",
|
||||||
"nodemailer-openpgp": "^1.0.2",
|
"nodemailer-openpgp": "^1.0.2",
|
||||||
"npmlog": "^4.0.2",
|
"npmlog": "^4.0.2",
|
||||||
"openpgp": "^2.3.5",
|
"openpgp": "^2.3.6",
|
||||||
"passport": "^0.3.2",
|
"passport": "^0.3.2",
|
||||||
"passport-local": "^1.0.0",
|
"passport-local": "^1.0.0",
|
||||||
"redfour": "^1.0.0",
|
"redfour": "^1.0.0",
|
||||||
"redis": "^2.6.3",
|
"redis": "^2.6.5",
|
||||||
"request": "^2.79.0",
|
"request": "^2.79.0",
|
||||||
"serve-favicon": "^2.3.2",
|
"serve-favicon": "^2.3.2",
|
||||||
"shortid": "^2.2.6",
|
"shortid": "^2.2.6",
|
||||||
"slugify": "^1.0.2",
|
"slugify": "^1.1.0",
|
||||||
"smtp-server": "^1.17.0",
|
"smtp-server": "^1.17.0",
|
||||||
"striptags": "^2.1.1",
|
"striptags": "^2.2.1",
|
||||||
"toml": "^2.3.1"
|
"toml": "^2.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,6 +191,20 @@ router.post('/ajax/:id', (req, res) => {
|
||||||
try {
|
try {
|
||||||
value = openpgp.key.readArmored(value);
|
value = openpgp.key.readArmored(value);
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|
||||||
|
let keys = value.keys;
|
||||||
|
for (let i = 0; i < keys.length; i++) {
|
||||||
|
let key = keys[i];
|
||||||
|
switch (key.verifyPrimaryKey()) {
|
||||||
|
case 0:
|
||||||
|
return 'Invalid key';
|
||||||
|
case 1:
|
||||||
|
return 'Expired key';
|
||||||
|
case 2:
|
||||||
|
return 'Revoked key';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
value = value.keys && value.keys[0] && value.keys[0].primaryKey.fingerprint;
|
value = value.keys && value.keys[0] && value.keys[0].primaryKey.fingerprint;
|
||||||
if (value) {
|
if (value) {
|
||||||
value = '0x' + value.substr(-16).toUpperCase();
|
value = '0x' + value.substr(-16).toUpperCase();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue