-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(frontend): escaping properly and making url safe
- Loading branch information
1 parent
fdee121
commit f2f1f54
Showing
4 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
@using System.Web | ||
<div class="modal fade" id="[email protected](MangaId)" tabindex="-1"> | ||
<div class="modal fade" id="add-manga-modal-@SafeMangaId" tabindex="-1"> | ||
<div class="modal-dialog modal-dialog-centered"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using System.Web; | ||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace Mangarr.Frontend.Pages.Manga.Link; | ||
|
||
public partial class AddModal | ||
{ | ||
private bool _monitorNewChaptersOnly; | ||
[Parameter] public string Id { get; set; } = null!; | ||
[Parameter] public string Identifier { get; set; } = null!; | ||
[Parameter] public string MangaId { get; set; } = null!; | ||
|
||
[Inject] public NavigationManager NavigationManager { get; set; } = null!; | ||
private string SafeMangaId => MangaId.Replace('+', '-').Replace('/', '_').Replace('=', '.'); | ||
|
||
private bool _monitorNewChaptersOnly; | ||
[Inject] public NavigationManager NavigationManager { get; set; } = null!; | ||
|
||
private void ToggleMonitorNewChaptersOnly() => _monitorNewChaptersOnly = !_monitorNewChaptersOnly; | ||
|
||
private void OnAddClick() => | ||
NavigationManager.NavigateTo($"/manga/{Id}/add/{Identifier}/{MangaId}/{_monitorNewChaptersOnly}"); | ||
NavigationManager.NavigateTo( | ||
$"/manga/{Id}/add/{Identifier}/{HttpUtility.UrlEncode(MangaId)}/{_monitorNewChaptersOnly}"); | ||
} |
5 changes: 2 additions & 3 deletions
5
src/Mangarr.Frontend/Pages/Manga/Link/ContentSourceItem.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
@using System.Web | ||
<div class="d-flex flex-column card p-2 me-2 content-source-item"> | ||
<div class="d-flex flex-column card p-2 me-2 content-source-item"> | ||
<img class="content-source-item-cover" src="@CoverImage" alt="cover" referrerpolicy="no-referrer"> | ||
<p class="text-truncate">@Title</p> | ||
<button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#add-manga-modal-@HttpUtility.UrlEncode(MangaId)">Select</button> | ||
<button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#add-manga-modal-@SafeMangaId">Select</button> | ||
</div> | ||
|
||
<AddModal Id="@Id" Identifier="@Identifier" MangaId="@MangaId"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters