Skip to content

Commit

Permalink
Switched to using safe string for navigation slug (#10267)
Browse files Browse the repository at this point in the history
closes 10258

- we should use consistent tooling for generating slugs across the whole of Ghost
  • Loading branch information
TJYSunset authored and ErisDS committed Dec 13, 2018
1 parent c2275ed commit 2860dde
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/server/helpers/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2860dde

Please sign in to comment.