Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
59683318
Commit
59683318
authored
Apr 19, 2019
by
Nick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: block single letter pages + RTL admin label in dark mode fix
parent
5b64c951
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
admin-locale.vue
client/components/admin/admin-locale.vue
+1
-1
page.js
server/helpers/page.js
+5
-2
No files found.
client/components/admin/admin-locale.vue
View file @
59683318
...
...
@@ -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'
)
...
...
server/helpers/page.js
View file @
59683318
...
...
@@ -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
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment