Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/Http/Controllers/Select/AlertRuleController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* AlertRuleController.php
*
Expand Down Expand Up @@ -58,7 +59,7 @@ public function baseQuery(Request $request): Builder
public function formatItem(Model $model): array
{
return [
'id' => $model->id,
'id' => $model->id,
'text' => $model->name,
];
}
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Requests/AlertTemplateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ public function withValidator(Validator $validator): void
$test_data['alert'] = new AlertData(AlertData::testData($test_device));

foreach ($fields as $fieldName => $templateString) {
if (empty($templateString) || !is_string($templateString)) {
if (empty($templateString) || ! is_string($templateString)) {
continue;
}

try {
Blade::render($templateString, $test_data, true); // unsafe

} catch (\Throwable $e) {
$v->errors()->add($fieldName, "The $fieldName field has invalid template syntax: " . $e->getMessage());
}
Expand Down
Loading