Ghost/ghost/security/lib/string.js
Rish 58084ac96e Updated to use slugify method from SDK for safe string
refs #10618

- Updated lib safe string security method
2019-05-07 15:33:07 +05:30

12 lines
358 B
JavaScript

const _ = require('lodash');
const slugify = require('@tryghost/string').slugify;
module.exports.safe = function safe(string, options) {
options = options || {};
let opts = {requiredChangesOnly: true};
if (!_.has(options, 'importing') || !options.importing) {
opts.requiredChangesOnly = false;
}
return slugify(string, opts);
};