Skip to content

Commit 8144535

Browse files
committed
Prevent invalid service tag names, ref pterodactyl#443
1 parent 7460b5f commit 8144535

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
99
* Fixes 'Remember Me' checkbox being ignored when using 2FA on an account.
1010
* API now returns a useful error displaying what went wrong rather than an obscure 'An Error was Encountered' message when API issues arise.
1111
* Fixes bug preventing the creation of new files in the file manager due to a missing JS dependency on page load.
12+
* Prevent using a service option tag that contains special chaacters that are not valid. Now only allows alpha-numeric, no spaces or underscores.
1213

1314
### Changed
1415
* Renamed session cookies from `laravel_session` to `pterodactyl_session`.

app/Repositories/OptionRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function create(array $data)
4747
'service_id' => 'required|numeric|exists:services,id',
4848
'name' => 'required|string|max:255',
4949
'description' => 'required|string',
50-
'tag' => 'required|string|max:255|unique:service_options,tag',
50+
'tag' => 'required|alpha_num|max:60|unique:service_options,tag',
5151
'docker_image' => 'sometimes|string|max:255',
5252
'startup' => 'sometimes|nullable|string',
5353
'config_from' => 'sometimes|required|numeric|exists:service_options,id',

resources/themes/pterodactyl/admin/services/options/new.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<div class="form-group">
6767
<label for="pTag" class="form-label">Option Tag</label>
6868
<input type="text" id="pTag" name="tag" value="{{ old('tag') }}" class="form-control" />
69-
<p class="text-muted small">This should be a unique identifer for this service option that is not used for any other service options.</p>
69+
<p class="text-muted small">This should be a unique identifer for this service option that is not used for any other service options. Must be alpha-numeric and no more than 60 characters in length.</p>
7070
</div>
7171
<div class="form-group">
7272
<label for="pDockerImage" class="form-label">Docker Image</label>

0 commit comments

Comments
 (0)