From 7946431b8d2fc519b00f85ed8e3618b8df992112 Mon Sep 17 00:00:00 2001 From: ali Date: Mon, 25 Nov 2013 06:15:04 +0000 Subject: [PATCH] Issue #1556 - Fix meta_title is undefined Closes #1556 and #1530 This should also fix meta_description in #1530 as well as the other bug that is not filed for body_class --- core/server/middleware/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/server/middleware/index.js b/core/server/middleware/index.js index feaf589c25..d0c159d7a6 100644 --- a/core/server/middleware/index.js +++ b/core/server/middleware/index.js @@ -24,7 +24,8 @@ function ghostLocals(req, res, next) { res.locals.version = packageInfo.version; res.locals.path = req.path; res.locals.csrfToken = req.csrfToken(); - res.locals.ghostRoot = req.path.replace(ghost.blogGlobals().path, ''); + // Strip off the subdir part of the path + res.locals.ghostRoot = req.path.replace(ghost.blogGlobals().path.replace(/\/$/, ''), ''); if (res.isAdmin) { api.users.read({id: req.session.user}).then(function (currentUser) {