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
3 changes: 3 additions & 0 deletions src/BootstrapBlazor.Server/Components/Samples/Masks.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<h4>@Localizer["MaskDescription"]</h4>

<DemoBlock Title="@Localizer["MaskNormalTitle"]" Introduction="@Localizer["MaskNormalIntro"]" Name="Normal">
<section ignore>
<div>@((MarkupString)Localizer["MaskNormalDesc"].Value)</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Directly rendering localized HTML via MarkupString may introduce XSS risks.

Sanitize or validate all localized content before rendering as raw HTML to prevent XSS vulnerabilities.

</section>
<button class="btn btn-primary" @onclick="@ShowMask">@Localizer["ShowMaskButtonText"]</button>
</DemoBlock>

Expand Down
1 change: 1 addition & 0 deletions src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@
"MaskDescription": "By calling the service display and hide methods, a mask layer is displayed to mask the data.",
"MaskNormalTitle": "Basic usage",
"MaskNormalIntro": "Call the <code>MaskService</code> mask service example method <code>Show</code> to display a mask, and call the instance method <code>Close</code> to close the mask after 3 seconds",
"MaskNormalDesc": "You can adjust the <code>ZIndex</code> <code>Opacity</code> <code>BackgroundColor</code> parameters via <code>MaskOption</code>",
"ShowMaskButtonText": "Show",
"MaskContainerTitle": "Container",
"MaskContainerIntro": "Specify the mask position by setting the <code>MaskOption</code> parameter <code>ContainerId</code>",
Expand Down
1 change: 1 addition & 0 deletions src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@
"MaskDescription": "通过调用服务显示,隐藏方法,显示一个遮罩层对数据进行遮罩操作",
"MaskNormalTitle": "基本用法",
"MaskNormalIntro": "调用 <code>MaskService</code> 遮罩服务示例方法 <code>Show</code> 方法显示一个遮罩,3 秒后调用实例方法 <code>Close</code> 关闭遮罩",
"MaskNormalDesc": "可以通过 <code>MaskOption</code> 调整 <code>ZIndex</code> <code>Opacity</code> <code>BackgroundColor</code> 参数",
"ShowMaskButtonText": "打开",
"MaskContainerTitle": "指定容器",
"MaskContainerIntro": "通过设置 <code>MaskOption</code> 参数 <code>ContainerId</code> 指定遮罩出现位置",
Expand Down
Loading