Skip to content

Commit

Permalink
search: make page number resilient against negative values (#2045)
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterjun3 authored Nov 26, 2024
1 parent a219816 commit 7b99e11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions TASVideos/Pages/Search/Advanced.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class AdvancedModel(ApplicationDbContext db) : BasePageModel
public string SearchTerms { get; set; } = "";

[FromQuery]
[Range(1, int.MaxValue)]
public int PageNumber { get; set; } = 1;

public List<PageResult> PageResults { get; set; } = [];
Expand Down
1 change: 1 addition & 0 deletions TASVideos/Pages/Search/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class IndexModel(ApplicationDbContext db) : BasePageModel
public string SearchTerms { get; set; } = "";

[FromQuery]
[Range(1, int.MaxValue)]
public int PageNumber { get; set; } = 1;

public List<PageSearch> PageResults { get; set; } = [];
Expand Down

0 comments on commit 7b99e11

Please sign in to comment.