Removed dependency on String.js in accordance with https://nodesecuri… (#387)

* Removed dependency on String.js in accordance with https://nodesecurity.io/advisories/536

* only strip img tags
main
Julian Lam 7 years ago committed by GitHub
parent b806a201f4
commit dad6e1ca2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var S = require('string'); var striptags = require('striptags');
var meta = module.parent.require('./meta'); var meta = module.parent.require('./meta');
var user = module.parent.require('./user'); var user = module.parent.require('./user');
@ -29,7 +29,7 @@ library.addAdminNavigation = function(header, callback) {
library.getTeasers = function(data, callback) { library.getTeasers = function(data, callback) {
data.teasers.forEach(function(teaser) { data.teasers.forEach(function(teaser) {
if (teaser && teaser.content) { if (teaser && teaser.content) {
teaser.content = S(teaser.content).stripTags('img').s; teaser.content = striptags(teaser.content, ['img']);
} }
}); });
callback(null, data); callback(null, data);

@ -39,6 +39,6 @@
"url": "https://github.com/psychobunny/nodebb-theme-persona/issues" "url": "https://github.com/psychobunny/nodebb-theme-persona/issues"
}, },
"dependencies": { "dependencies": {
"string": "^3.3.3" "striptags": "^3.1.0"
} }
} }

@ -0,0 +1,7 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
striptags@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.1.0.tgz#763e534338d9cf542f004a4b1eb099e32d295e44"
Loading…
Cancel
Save