mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-08 21:08:39 +00:00
Prevent possible XSS
This commit is contained in:
parent
939e192732
commit
1884ffd95f
1 changed files with 12 additions and 8 deletions
|
@ -66,15 +66,19 @@
|
||||||
<div>
|
<div>
|
||||||
<h3>@Model.LatestAnnouncement.Title</h3>
|
<h3>@Model.LatestAnnouncement.Title</h3>
|
||||||
<div style="padding-bottom: 2em;">
|
<div style="padding-bottom: 2em;">
|
||||||
<span style="white-space: pre-line">
|
@if (Model.LatestAnnouncement.Content.Length > 250)
|
||||||
@{
|
{
|
||||||
string truncatedAnnouncement = Model.LatestAnnouncement.Content.Length > 250
|
<span style="white-space: pre-line">
|
||||||
? Model.LatestAnnouncement.Content[..250] +
|
@Model.LatestAnnouncement.Content[..250]
|
||||||
$"... <a href='{ServerConfiguration.Instance.ExternalUrl}/notifications'>read more</a>"
|
<a href="@ServerConfiguration.Instance.ExternalUrl/notifications">read more</a>
|
||||||
: Model.LatestAnnouncement.Content;
|
</span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<span style="white-space: pre-line">
|
||||||
|
@Model.LatestAnnouncement.Content
|
||||||
|
</span>
|
||||||
}
|
}
|
||||||
@Html.Raw(truncatedAnnouncement)
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
@if (Model.LatestAnnouncement.Publisher != null)
|
@if (Model.LatestAnnouncement.Publisher != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue