mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 20:09:09 +08:00
Checked page parameter to ensure a integer numeric value is provided. (#8644)
This commit is contained in:
parent
2a1b0b3af3
commit
eed4a6a11b
@ -51,7 +51,11 @@ namespace Orchard.Taxonomies.Drivers {
|
||||
var pagerParameters = new PagerParameters();
|
||||
var httpContext = _httpContextAccessor.Current();
|
||||
if (httpContext != null) {
|
||||
pagerParameters.Page = Convert.ToInt32(httpContext.Request.QueryString["page"]);
|
||||
// Check if "page" parameter is a valid number.
|
||||
int page = 0;
|
||||
if (int.TryParse(httpContext.Request.QueryString["page"], out page)) {
|
||||
pagerParameters.Page = page;
|
||||
}
|
||||
}
|
||||
|
||||
var pager = new Pager(_siteService.GetSiteSettings(), pagerParameters);
|
||||
|
Loading…
Reference in New Issue
Block a user