Merge pull request #12131 from snipe/fixes/check_for_format_index_in_custom_field_api_call

Fixed 500 if `format` is not passed to the create custom field endpoint payload
This commit is contained in:
snipe 2022-11-16 15:57:07 +00:00 committed by GitHub
commit 4ffe13d3c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,7 +96,7 @@ class CustomFieldsController extends Controller
$data = $request->all(); $data = $request->all();
$regex_format = null; $regex_format = null;
if (str_contains($data['format'], 'regex:')) { if ((array_key_exists('format', $data)) && (str_contains($data['format'], 'regex:'))) {
$regex_format = $data['format']; $regex_format = $data['format'];
} }