0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Switched to using safe string for navigation slug (#10267)

closes 10258

- we should use consistent tooling for generating slugs across the whole of Ghost
This commit is contained in:
Todd Justin York 2018-12-13 20:30:56 +08:00 committed by Hannah Wolfe
parent c2275ed131
commit 2860ddeb3b

View file

@ -3,6 +3,7 @@
// Outputs navigation menu of static urls
var proxy = require('./proxy'),
string = require('../lib/security/string'),
_ = require('lodash'),
SafeString = proxy.SafeString,
i18n = proxy.i18n,
@ -41,7 +42,7 @@ module.exports = function navigation(options) {
}
function _slugify(label) {
return label.toLowerCase().replace(/[^\w ]+/g, '').replace(/ +/g, '-');
return string.safe(label);
}
// strips trailing slashes and compares urls