Skip to content
Merged
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
4 changes: 2 additions & 2 deletions resources/views/livewire/manage-custom-field.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class="h-4.5 w-4.5 text-neutral-700 dark:text-neutral-400 ml-2"

{{
$this->editAction()->icon(false)
->label(new HtmlString('<span class="truncate flex">'.$field->name.'</span>'))
->extraAttributes(['class' => 'truncate', 'x-tooltip.raw' => $field->name])
->label(new HtmlString('<span class="truncate flex">'.e($field->name).'</span>'))
->extraAttributes(['class' => 'truncate', 'x-tooltip.raw' => e($field->name)])
->link()
}}

Expand Down
11 changes: 11 additions & 0 deletions tests/Feature/Admin/Pages/CustomFieldsFieldManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,17 @@
]);
});

it('renders the field name as text in the field row', function (): void {
$this->field->update(['name' => '"><img src=x onerror=alert(1)>']);

livewire(ManageCustomField::class, [
'field' => $this->field,
])
->assertDontSeeHtml('<img src=x onerror=alert(1)>')
->assertSeeHtml('<span class="truncate flex">&quot;&gt;&lt;img src=x onerror=alert(1)&gt;</span>')
->assertSeeHtml('x-tooltip.raw="&quot;&gt;&lt;img src=x onerror=alert(1)&gt;"');
});

it('can activate an inactive field', function (): void {
// Arrange
$inactiveField = CustomField::factory()
Expand Down
Loading