Skip to content

Node.js based forum software built for the modern web

fixes adding new routes to user/xxx/route

psychobunnya7d73d410615
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index 4896c58195..8a5fa5b4fa 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -195,7 +195,8 @@ $(document).ready(function() {
ajaxify.getCustomTemplateMapping = function(tpl) {
if (templatesModule.config && templatesModule.config.custom_mapping && tpl !== undefined) {
for (var pattern in templatesModule.config.custom_mapping) {
- if (tpl.match(pattern)) {
+ var match = tpl.match(pattern);
+ if (match && match[0] === tpl) {
return (templatesModule.config.custom_mapping[pattern]);
}
}
diff --git a/src/views/config.json b/src/views/config.json
index 70ba11b3af..7a7a5da07d 100644
--- a/src/views/config.json
+++ b/src/views/config.json
@@ -13,7 +13,7 @@
"^user/.*/favourites": "account/favourites",
"^user/.*/posts": "account/posts",
"^user/.*/topics": "account/topics",
- "^user/.*": "account/profile",
+ "^user/[.^\/]*": "account/profile",
"^reset/.*": "reset_code",
"^tags/.*": "tag",
"^groups/?$": "groups/list",