Skip to content

Commit

Permalink
Prevent href attribute from escaping ampersands
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Oct 3, 2024
1 parent a4834da commit 68a4ef5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stubs/resources/views/flux/button-or-link.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
@endphp

<?php if ($href): ?>
<a href="{{ $href }}" {{ $attributes->merge(['data-current' => $current]) }}>
{{-- We are using e() here to escape the href attribute value instead of "{{ }}" because the latter will escape the entire attribute value, including the "&" character... --}}
<a href="{!! e($href) !!}" {{ $attributes->merge(['data-current' => $current]) }}>
{{ $slot }}
</a>
<?php else: ?>
Expand Down

0 comments on commit 68a4ef5

Please sign in to comment.