Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ARSnova
arsnova-click-v2-backend
Commits
b7041bb6
Commit
b7041bb6
authored
Apr 28, 2019
by
Christopher Mark Fullarton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes regexp escaping
parent
f88f1062
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/db/MemberDAO.ts
src/db/MemberDAO.ts
+1
-1
src/db/quiz/QuizDAO.ts
src/db/quiz/QuizDAO.ts
+4
-4
No files found.
src/db/MemberDAO.ts
View file @
b7041bb6
...
...
@@ -84,7 +84,7 @@ class MemberDAO extends AbstractDAO<Array<MemberEntity>> {
}
public
getMembersOfQuiz
(
quizName
:
string
):
Array
<
IMemberEntity
>
{
return
this
.
storage
.
filter
(
val
=>
!!
val
.
currentQuizName
.
match
(
new
RegExp
(
`^
${
quizName
}
$`
,
'
i
'
)));
return
this
.
storage
.
filter
(
val
=>
!!
val
.
currentQuizName
.
match
(
new
RegExp
(
`^
${
RegExp
.
escape
(
quizName
)
}
$`
,
'
i
'
)));
}
public
getMemberByToken
(
token
:
string
):
MemberEntity
{
...
...
src/db/quiz/QuizDAO.ts
View file @
b7041bb6
...
...
@@ -204,7 +204,7 @@ class QuizDAO extends AbstractDAO<Array<IQuizEntity>> {
}
public
getQuizByName
(
name
:
string
):
IQuizEntity
{
return
this
.
storage
.
find
(
val
=>
!!
val
.
name
.
trim
().
match
(
new
RegExp
(
RegExp
.
escape
(
`^
${
name
.
trim
()}
$`
)
,
'
i
'
)));
return
this
.
storage
.
find
(
val
=>
!!
RegExp
.
escape
(
`
${
val
.
name
.
trim
()
}
`
)
.
match
(
new
RegExp
(
`^
${
RegExp
.
escape
(
name
.
trim
()
)
}
$`
,
'
i
'
)));
}
public
getExpiryQuizzes
():
Array
<
IQuizEntity
>
{
...
...
@@ -221,8 +221,8 @@ class QuizDAO extends AbstractDAO<Array<IQuizEntity>> {
return
this
.
storage
;
}
public
isActiveQuiz
(
quiz
n
ame
:
string
):
boolean
{
return
!!
this
.
getActiveQuizzes
().
find
(
val
=>
!!
val
.
name
.
match
(
new
RegExp
(
`^
${
quiz
n
ame
}
$`
,
'
i
'
)));
public
isActiveQuiz
(
quiz
N
ame
:
string
):
boolean
{
return
!!
this
.
getActiveQuizzes
().
find
(
val
=>
!!
val
.
name
.
match
(
new
RegExp
(
`^
${
RegExp
.
escape
(
quiz
N
ame
)
}
$`
,
'
i
'
)));
}
public
setQuizAsInactive
(
quizName
:
string
):
void
{
...
...
@@ -230,7 +230,7 @@ class QuizDAO extends AbstractDAO<Array<IQuizEntity>> {
}
public
getActiveQuizByName
(
quizName
:
string
):
IQuizEntity
{
return
this
.
getActiveQuizzes
().
find
(
val
=>
!!
val
.
name
.
match
(
new
RegExp
(
`^
${
quizName
}
$`
,
'
i
'
)));
return
this
.
getActiveQuizzes
().
find
(
val
=>
!!
val
.
name
.
match
(
new
RegExp
(
`^
${
RegExp
.
escape
(
quizName
)
}
$`
,
'
i
'
)));
}
public
getQuizBySocket
(
ws
:
WebSocket
):
IQuizEntity
{
...
...
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