Skip to content

A free open source IT asset/license management system

Fixed HTML in help text

snipe8bc13ab77f97
diff --git a/resources/views/blade/form/checkbox-row.blade.php b/resources/views/blade/form/checkbox-row.blade.php
index f1ca30a831..128bb960c2 100644
--- a/resources/views/blade/form/checkbox-row.blade.php
+++ b/resources/views/blade/form/checkbox-row.blade.php
@@ -8,6 +8,11 @@
'required' => null,
'disabled' => false,
'help_text' => null,
+ // Opt-in raw-HTML help. Rendered UNESCAPED — only pass developer-authored
+ // strings (translation strings with anchors, <code>, <br>, etc.). Never
+ // pass anything that could contain user input without escaping it first.
+ // See x-form.row for the same prop with the same semantics.
+ 'help_html' => null,
'help_icon' => null,
'info_tooltip_text' => null,
// Optional left-column section header for single-checkbox rows that need
@@ -163,6 +168,22 @@
<div class="col-md-8 col-md-offset-3">
<x-form.help :name="$name" :icon="$help_icon">{!! $help_text !!}</x-form.help>
</div>
+ @elseif ($help_html)
+ {{-- Raw HTML help — caller has opted in via help_html rather than
+ help_text. Callers passing a trans() string with HTML MUST use
+ the static-attribute form help_html="{!! trans('...') !!}" —
+ the dynamic-binding form :help_html="trans('...')" runs the
+ value through BladeCompiler::sanitizeComponentAttribute() and
+ turns <a> tags into &lt;a&gt; entities. See x-form.row for the
+ same wiring. --}}
+ <div class="col-md-8 col-md-offset-3">
+ <p class="help-block" id="{{ $name }}-help">
+ @if ($help_icon)
+ <x-icon :type="$help_icon" />
+ @endif
+ {!! $help_html !!}
+ </p>
+ </div>
@endif
</div>
diff --git a/resources/views/hardware/bulk-audit.blade.php b/resources/views/hardware/bulk-audit.blade.php
index 9b1d1cfefd..34eb163df2 100644
--- a/resources/views/hardware/bulk-audit.blade.php
+++ b/resources/views/hardware/bulk-audit.blade.php
@@ -60,7 +60,7 @@
<x-form.checkbox-row
name="update_location"
:label="trans('admin/hardware/form.asset_location')"
- :help_html="trans('help.audit_help')"
+ help_html="{!! trans('help.audit_help') !!}"
/>
@endif
diff --git a/resources/views/livewire/custom-field-editor.blade.php b/resources/views/livewire/custom-field-editor.blade.php
index 1fb7c852c9..58d0d65f50 100644
--- a/resources/views/livewire/custom-field-editor.blade.php
+++ b/resources/views/livewire/custom-field-editor.blade.php
@@ -138,7 +138,7 @@
:label="trans('admin/custom_fields/general.field_custom_format')"
name="custom_format"
required
- :help_html="trans('admin/custom_fields/general.field_custom_format_help')"
+ help_html="{!! trans('admin/custom_fields/general.field_custom_format_help') !!}"
>
<x-slot:input>
<input
diff --git a/resources/views/manufacturers/edit.blade.php b/resources/views/manufacturers/edit.blade.php
index 7f1ab62996..3e73ec6f53 100755
--- a/resources/views/manufacturers/edit.blade.php
+++ b/resources/views/manufacturers/edit.blade.php
@@ -43,7 +43,7 @@
:$item
name="support_url"
type="url"
- :help_html="trans('admin/manufacturers/message.support_url_help')"
+ help_html="{!! trans('admin/manufacturers/message.support_url_help') !!}"
input_icon="link"
input_group_addon="left"
placeholder="https://example.com"
@@ -54,7 +54,7 @@
:$item
name="warranty_lookup_url"
type="url"
- :help_html="trans('admin/manufacturers/message.support_url_help')"
+ help_html="{!! trans('admin/manufacturers/message.support_url_help') !!}"
input_icon="link"
input_group_addon="left"
placeholder="https://example.com"
diff --git a/resources/views/settings/security.blade.php b/resources/views/settings/security.blade.php
index 9b63714f57..47684a9dc3 100644
--- a/resources/views/settings/security.blade.php
+++ b/resources/views/settings/security.blade.php
@@ -156,7 +156,7 @@
<x-form.row
name="login_remote_user_header_name"
:label="trans('admin/settings/general.login_remote_user_header_name_text')"
- :help_html="trans('admin/settings/general.login_remote_user_header_name_help')"
+ help_html="{!! trans('admin/settings/general.login_remote_user_header_name_help') !!}"
help_icon="warning"
>
<x-slot:input>