fix: block single letter pages + RTL admin label in dark mode fix

pull/821/head
Nick 6 years ago
parent 5b64c95117
commit 596833180e

@ -112,7 +112,7 @@
v-list-tile-title(v-html='lc.name')
v-list-tile-sub-title(v-html='lc.nativeName')
v-list-tile-action(v-if='lc.isRTL')
v-chip(label, small).caption.grey--text.text--darken-2 RTL
v-chip(label, small, :class='$vuetify.dark ? `text--lighten-5` : `text--darken-2`').caption.grey--text RTL
v-list-tile-action(v-if='lc.isInstalled && lc.installDate < lc.updatedAt', @click='download(lc.code)')
v-icon.blue--text cached
v-list-tile-action(v-else-if='lc.isInstalled')

@ -2,6 +2,9 @@ const qs = require('querystring')
const _ = require('lodash')
const crypto = require('crypto')
const localeSegmentRegex = /^[A-Z]{2}(-[A-Z]{2})?$/gi
const systemSegmentRegex = /^[A-Z]\//gi
module.exports = {
/**
* Parse raw url path and make it safe
@ -24,7 +27,7 @@ module.exports = {
if (pathParts[0].length === 1) {
pathParts.shift()
}
if (pathParts[0].length === 2) {
if (localeSegmentRegex.test(pathParts[0])) {
pathObj.locale = pathParts[0]
pathParts.shift()
}
@ -61,6 +64,6 @@ module.exports = {
* Check if path is a reserved path
*/
isReservedPath(rawPath)  {
return _.some(WIKI.data.reservedPaths, p => _.startsWith(rawPath, p))
return _.some(WIKI.data.reservedPaths, p => _.startsWith(rawPath, p)) || systemSegmentRegex.test(rawPath)
}
}

Loading…
Cancel
Save