Browse Source

fix: page hands when attempting to create a 2 letters page

pull/880/head
Nick 5 years ago
parent
commit
7a09601a10
1 changed files with 2 additions and 2 deletions
  1. 4
      server/helpers/page.js

4
server/helpers/page.js

@ -35,7 +35,7 @@ module.exports = {
} }
// Strip extension // Strip extension
if (opts.stripExt) {
if (opts.stripExt && pathParts.length > 0) {
const lastPart = _.last(pathParts) const lastPart = _.last(pathParts)
if (lastPart.indexOf('.') > 0) { if (lastPart.indexOf('.') > 0) {
pathParts.pop() pathParts.pop()
@ -78,7 +78,7 @@ module.exports = {
*/ */
isReservedPath(rawPath) { isReservedPath(rawPath) {
const firstSection = _.head(rawPath.split('/')) const firstSection = _.head(rawPath.split('/'))
if (firstSection.length === 1) {
if (firstSection.length <= 1) {
return true return true
} else if (localeSegmentRegex.test(firstSection)) { } else if (localeSegmentRegex.test(firstSection)) {
return true return true

Loading…
Cancel
Save