Skip to content

Commit 1c5f892

Browse files
committed
backfill fixes from 65957e7 to address pterodactyl#470 in active release
1 parent 32b639e commit 1c5f892

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

app/Http/Controllers/Admin/OptionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function editVariable(Request $request, $option, $variable)
209209

210210
try {
211211
if ($request->input('action') !== 'delete') {
212-
$variable = $repo->update($variable, $request->intersect([
212+
$variable = $repo->update($variable, $request->only([
213213
'name', 'description', 'env_variable',
214214
'default_value', 'options', 'rules',
215215
]));

app/Repositories/VariableRepository.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,11 @@ public function update($id, array $data)
123123
$variable = ServiceVariable::findOrFail($id);
124124

125125
$validator = Validator::make($data, [
126-
'name' => 'sometimes|required|string|min:1|max:255',
127-
'description' => 'sometimes|nullable|string',
128-
'env_variable' => 'sometimes|required|regex:/^[\w]{1,255}$/',
129-
'default_value' => 'string',
126+
'name' => 'required|string|min:1|max:255',
127+
'description' => 'nullable|string',
128+
'env_variable' => 'required|regex:/^[\w]{1,255}$/',
129+
'rules' => 'bail|required|string',
130130
'options' => 'sometimes|required|array',
131-
'rules' => 'bail|sometimes|required|string|min:1',
132131
]);
133132

134133
// Ensure the default value is allowed by the rules provided.

0 commit comments

Comments
 (0)