mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #5002 from ErisDS/issue-4989
Fixing overzealous trailing-slashes
This commit is contained in:
commit
18015809a4
1 changed files with 2 additions and 1 deletions
|
@ -128,8 +128,9 @@ NavigationController = Ember.Controller.extend({
|
||||||
url = match[1];
|
url = match[1];
|
||||||
|
|
||||||
// if the last char is not a slash, then add one,
|
// if the last char is not a slash, then add one,
|
||||||
|
// as long as there is no # or . in the URL (anchor or file extension)
|
||||||
// this also handles the empty case for the homepage
|
// this also handles the empty case for the homepage
|
||||||
if (url[url.length - 1] !== '/') {
|
if (url[url.length - 1] !== '/' && url.indexOf('#') === -1 && url.indexOf('.') === -1) {
|
||||||
url += '/';
|
url += '/';
|
||||||
}
|
}
|
||||||
} else if (!validator.isURL(url) && url !== '' && url[0] !== '/' && url.indexOf('mailto:') !== 0) {
|
} else if (!validator.isURL(url) && url !== '' && url[0] !== '/' && url.indexOf('mailto:') !== 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue