Skip to content

Commit 9116547

Browse files
committed
allow emptying server description, closes pterodactyl#442
1 parent 0e48c94 commit 9116547

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1515
### Changed
1616
* Renamed session cookies from `laravel_session` to `pterodactyl_session`.
1717
* Sessions are now encrypted before being stored as an additional layer of security.
18+
* It is now possible to clear out a server description and have it be blank, rather than throwing an error about the field being required.
1819

1920
## v0.6.0 (Courageous Carniadactylus)
2021
### Fixed

app/Http/Controllers/Admin/ServersController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,12 @@ public function setDetails(Request $request, $id)
273273
{
274274
$repo = new ServerRepository;
275275
try {
276-
$repo->updateDetails($id, $request->intersect([
277-
'owner_id', 'name', 'description', 'reset_token',
278-
]));
276+
$repo->updateDetails($id, array_merge(
277+
$request->only('description'),
278+
$request->intersect([
279+
'owner_id', 'name', 'reset_token',
280+
])
281+
));
279282

280283
Alert::success('Server details were successfully updated.')->flash();
281284
} catch (DisplayValidationException $ex) {

app/Repositories/ServerRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public function updateDetails($id, array $data)
370370
$validator = Validator::make($data, [
371371
'owner_id' => 'sometimes|required|integer|exists:users,id',
372372
'name' => 'sometimes|required|regex:([\w .-]{1,200})',
373-
'description' => 'sometimes|required|string',
373+
'description' => 'sometimes|nullable|string',
374374
'reset_token' => 'sometimes|required|accepted',
375375
]);
376376

0 commit comments

Comments
 (0)