mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-24 17:01:45 +00:00
fix pattern validation in event deletion
This commit is contained in:
parent
19a065ca13
commit
2b0716397c
1 changed files with 4 additions and 1 deletions
|
@ -77,6 +77,9 @@ export default class EventMixin extends mixins(Vue) {
|
|||
}
|
||||
|
||||
protected async openDeleteEventModal(event: IEvent, currentActor: IPerson) {
|
||||
function escapeRegExp(string) {
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
}
|
||||
const participantsLength = event.participantStats.participant;
|
||||
const prefix = participantsLength
|
||||
? this.$tc('There are {participants} participants.', event.participantStats.participant, {
|
||||
|
@ -97,7 +100,7 @@ export default class EventMixin extends mixins(Vue) {
|
|||
) as string,
|
||||
inputAttrs: {
|
||||
placeholder: event.title,
|
||||
pattern: event.title,
|
||||
pattern: escapeRegExp(event.title),
|
||||
},
|
||||
onConfirm: () => this.deleteEvent(event, currentActor),
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue