mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-13 08:41:27 +00:00
Improve input validation for story level moderation
This commit is contained in:
parent
f965be88b7
commit
5c66b0f713
2 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ public class ModerationPageController : ControllerBase
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("findStoryLevel")]
|
[HttpPost("findStoryLevel")]
|
||||||
public async Task<IActionResult> FindStorySlot([FromForm] int placeholderSlotId)
|
public async Task<IActionResult> FindStorySlot([FromForm] int? placeholderSlotId)
|
||||||
{
|
{
|
||||||
UserEntity? user = this.database.UserFromWebRequest(this.Request);
|
UserEntity? user = this.database.UserFromWebRequest(this.Request);
|
||||||
if (user == null) return this.Redirect("~/login");
|
if (user == null) return this.Redirect("~/login");
|
||||||
|
@ -30,6 +30,6 @@ public class ModerationPageController : ControllerBase
|
||||||
.Select(s => s.SlotId)
|
.Select(s => s.SlotId)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
return this.Redirect(slotId == 0 ? "~/" : $"~/slot/{slotId}");
|
return this.Redirect(slotId == 0 ? "~/moderation" : $"~/slot/{slotId}");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -59,6 +59,6 @@ else
|
||||||
<button type="submit" class="ui blue button">
|
<button type="submit" class="ui blue button">
|
||||||
<span>Find Story Level</span>
|
<span>Find Story Level</span>
|
||||||
</button>
|
</button>
|
||||||
<input type="text" name="placeholderSlotId" placeholder="Level ID">
|
<input type="text" name="placeholderSlotId" placeholder="Level ID" minlength="1" pattern="^\d*$" required>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
Loading…
Add table
Add a link
Reference in a new issue