Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Wiggins authored and Roy Wiggins committed Dec 8, 2023
2 parents fdf1810 + 3ed0a3d commit d1855fa
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions webinterface/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ async def add_module(request):
form = dict(await request.form())
name = form.get("name", "")

if "/" in name:
return PlainTextResponse("Invalid module name provided.")

if name in config.mercure.modules:
return PlainTextResponse("A module with this name already exists.")

Expand Down
2 changes: 1 addition & 1 deletion webinterface/templates/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h1 class="title">Processing Modules</h1>
<form hx-post="./" hx-target="#addmodal_message" htmx-added="title">
<div class="field">
<p class="control">
<input class="input" id="addnewname" type="text" required pattern="[-_A-Za-z0-9]+"
<input class="input" id="addnewname" type="text" required pattern="[0-9a-zA-Z_\-]+"
placeholder="Name of module" name="name" autofocus>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion webinterface/templates/queue.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
<div class="panel" data-content="archive">
<div class="field has-addons" style="margin-top: 30px; margin-bottom: 30px;">
<div class="control is-expanded">
<input name="job_archive_search" id="job_archive_search" pattern="[-_A-Za-z0-9]+" onkeyup="this.value = this.value.replace(/[{}\x22\n]/g, '')"
<input name="job_archive_search" id="job_archive_search" pattern="[0-9a-zA-Z_\-]+" onkeyup="this.value = this.value.replace(/[{}\x22\n]/g, '')"
class="input series_completion_fix" autocomplete='off' type="text" placeholder="Find job by ACC, MRN, or patient name">
</div>
<div class="control">
Expand Down
2 changes: 1 addition & 1 deletion webinterface/templates/rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h1 class="title">DICOM Rules</h1>
<form method="post">
<div class="field">
<p class="control">
<input class="input" id="addnewname" type="text" required pattern="[-_A-Za-z0-9]+"
<input class="input" id="addnewname" type="text" required pattern="[0-9a-zA-Z_\-]+"
placeholder="Name of rule" name="name" autofocus>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion webinterface/templates/targets.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h1 class="title">Routing Targets</h1>
<form method="post">
<div class="field">
<p class="control">
<input class="input" id="addnewname" type="text" required pattern="[-_A-Za-z0-9]+"
<input class="input" id="addnewname" type="text" required pattern="[0-9a-zA-Z_\-]+"
placeholder="Name of target" name="name" autofocus>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion webinterface/templates/users.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h1 class="title">Users</h1>
<form method="post">
<div class="field">
<p class="control">
<input class="input" id="addnewname" type="text" required pattern="[-_A-Za-z0-9]+"
<input class="input" id="addnewname" type="text" required pattern="[0-9a-zA-Z_\-]+"
placeholder="Username" name="name" autofocus>
</p>
</div>
Expand Down

0 comments on commit d1855fa

Please sign in to comment.