diff --git a/Gruntfile.js b/Gruntfile.js index b89fe25f08..18f37ec148 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -337,7 +337,7 @@ module.exports = function (grunt) { // A list of files and patterns to include when creating a release zip. // This is read from the `.npmignore` file and all patterns are inverted as we want to define what to include src: fs.readFileSync('.npmignore', 'utf8').split('\n').filter(Boolean).map(function (pattern) { - return pattern[0] === '!' ? pattern.substr(1) : '!' + pattern; + return pattern[0] === '!' ? pattern.slice(1) : '!' + pattern; }), dest: '<%= paths.releaseBuild %>/' }); diff --git a/core/frontend/helpers/get.js b/core/frontend/helpers/get.js index 3b9b2659c4..80b039e144 100644 --- a/core/frontend/helpers/get.js +++ b/core/frontend/helpers/get.js @@ -80,7 +80,7 @@ function resolvePaths(globals, data, value) { path = path.replace(/\.\[/g, '['); if (path.charAt(0) === '@') { - result = jsonpath.query(globals, path.substr(1)); + result = jsonpath.query(globals, path.slice(1)); } else { // Do the query, which always returns an array of matches result = jsonpath.query(data, path); diff --git a/core/server/models/base/plugins/generate-slug.js b/core/server/models/base/plugins/generate-slug.js index 4086b091d8..84d4dfa1b0 100644 --- a/core/server/models/base/plugins/generate-slug.js +++ b/core/server/models/base/plugins/generate-slug.js @@ -79,7 +79,7 @@ module.exports = function (Bookshelf) { // If it's a user, let's try to cut it down (unless this is a human request) if (baseName === 'user' && options && options.shortSlug && slugTryCount === 1 && slug !== 'ghost-owner') { longSlug = slug; - slug = (slug.indexOf('-') > -1) ? slug.substr(0, slug.indexOf('-')) : slug; + slug = (slug.indexOf('-') > -1) ? slug.slice(0, slug.indexOf('-')) : slug; } if (!_.has(options, 'importing') || !options.importing) { @@ -118,4 +118,4 @@ module.exports = function (Bookshelf) { * @property {boolean} [importing] Set to true to don't cut the slug on import * @property {boolean} [shortSlug] If it's a user, let's try to cut it down (unless this is a human request) * @property {boolean} [skipDuplicateChecks] Don't append unique identifiers when the slug is not unique (this prevents any database queries) - */ \ No newline at end of file + */