From 4e5cba8c4c9cc8db8f9486a43aa9b774ba0e8b24 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Sat, 7 Mar 2015 21:09:50 +0000 Subject: [PATCH] Fixing overzealous trailing-slashes refs #4989 - Don't add a trailing a slash if the url is a file or anchor --- core/client/controllers/settings/navigation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/client/controllers/settings/navigation.js b/core/client/controllers/settings/navigation.js index ef798f83c5..9f450ed471 100644 --- a/core/client/controllers/settings/navigation.js +++ b/core/client/controllers/settings/navigation.js @@ -128,8 +128,9 @@ NavigationController = Ember.Controller.extend({ url = match[1]; // 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 - if (url[url.length - 1] !== '/') { + if (url[url.length - 1] !== '/' && url.indexOf('#') === -1 && url.indexOf('.') === -1) { url += '/'; } } else if (!validator.isURL(url) && url !== '' && url[0] !== '/') {