Merge pull request #14517 from snipe/bug/sc-25186/label_index

Check that the array key exists in the label engine
This commit is contained in:
snipe 2024-03-28 12:26:20 +00:00 committed by GitHub
commit 5f6c746d25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,9 +73,11 @@ class LabelsController extends Controller
->each(function ($item) use ($customFieldColumns, $exampleAsset) { ->each(function ($item) use ($customFieldColumns, $exampleAsset) {
$pair = explode('=', $item); $pair = explode('=', $item);
if (array_key_exists(1, $pair)) {
if ($customFieldColumns->contains($pair[1])) { if ($customFieldColumns->contains($pair[1])) {
$exampleAsset->{$pair[1]} = "{{$pair[0]}}"; $exampleAsset->{$pair[1]} = "{{$pair[0]}}";
} }
}
}); });
$settings = Setting::getSettings(); $settings = Setting::getSettings();