From 9ee91b35477b22be69a32f8ae70d49ffb975a502 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 23 Aug 2013 18:49:45 +0200 Subject: [PATCH] Fix for post with '?' closes #433 - if slug is empty after trimming use "post" as slug instead --- core/server/models/post.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/server/models/post.js b/core/server/models/post.js index 93bc354fc6..08e8f54323 100644 --- a/core/server/models/post.js +++ b/core/server/models/post.js @@ -109,6 +109,10 @@ Post = GhostBookshelf.Model.extend({ slug = /^(ghost|ghost\-admin|admin|wp\-admin|dashboard|login|archive|archives|category|categories|tag|tags|page|pages|post|posts)$/g .test(slug) ? slug + '-post' : slug; + //if slug is empty after trimming use "post" + if (!slug) { + slug = "post"; + } // Test for duplicate slugs. return checkIfSlugExists(slug); },