forked from woem.men/forkey
spec(pages): URLとして使用できる文字を制限 (MisskeyIO#873)
This commit is contained in:
parent
e1ae455e4a
commit
4f9aee899f
3 changed files with 5 additions and 5 deletions
|
@ -52,7 +52,7 @@ export const paramDef = {
|
|||
type: 'object',
|
||||
properties: {
|
||||
title: { type: 'string' },
|
||||
name: { type: 'string', minLength: 1 },
|
||||
name: { type: 'string', minLength: 1, pattern: /^[a-zA-Z0-9_-]+$/.toString().slice(1, -1) },
|
||||
summary: { type: 'string', nullable: true },
|
||||
content: { type: 'array', items: {
|
||||
type: 'object', additionalProperties: true,
|
||||
|
|
|
@ -57,7 +57,7 @@ export const paramDef = {
|
|||
properties: {
|
||||
pageId: { type: 'string', format: 'misskey:id' },
|
||||
title: { type: 'string' },
|
||||
name: { type: 'string', minLength: 1 },
|
||||
name: { type: 'string', minLength: 1, pattern: /^[a-zA-Z0-9_-]+$/.toString().slice(1, -1) },
|
||||
summary: { type: 'string', nullable: true },
|
||||
content: { type: 'array', items: {
|
||||
type: 'object', additionalProperties: true,
|
||||
|
|
|
@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template #label>{{ i18n.ts._pages.summary }}</template>
|
||||
</MkInput>
|
||||
|
||||
<MkInput v-model="name">
|
||||
<MkInput v-model="name" type="text" pattern="^[a-zA-Z0-9_-]+$" autocapitalize="off">
|
||||
<template #prefix>{{ url }}/@{{ author.username }}/pages/</template>
|
||||
<template #label>{{ i18n.ts._pages.url }}</template>
|
||||
</MkInput>
|
||||
|
@ -158,7 +158,7 @@ function save() {
|
|||
|
||||
if (pageId.value) {
|
||||
options.pageId = pageId.value;
|
||||
misskeyApi('pages/update', options)
|
||||
os.apiWithDialog('pages/update', options)
|
||||
.then(page => {
|
||||
currentName.value = name.value.trim();
|
||||
os.alert({
|
||||
|
@ -167,7 +167,7 @@ function save() {
|
|||
});
|
||||
}).catch(onError);
|
||||
} else {
|
||||
misskeyApi('pages/create', options)
|
||||
os.apiWithDialog('pages/create', options)
|
||||
.then(created => {
|
||||
pageId.value = created.id;
|
||||
currentName.value = name.value.trim();
|
||||
|
|
Loading…
Reference in a new issue