mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#19647: Validation feed query parameter
Work Item: 19647 --HG-- branch : 1.x
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.ContentManagement;
|
||||
@@ -25,8 +26,9 @@ namespace Orchard.Comments.Feeds {
|
||||
|
||||
var limit = 20;
|
||||
var limitValue = context.ValueProvider.GetValue("limit");
|
||||
if (limitValue != null)
|
||||
limit = (int)limitValue.ConvertTo(typeof(int));
|
||||
if (limitValue != null) {
|
||||
Int32.TryParse(Convert.ToString(limitValue), out limit);
|
||||
}
|
||||
|
||||
var comments = _contentManager
|
||||
.Query<CommentPart, CommentPartRecord>()
|
||||
|
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.ContentManagement;
|
||||
@@ -25,8 +26,9 @@ namespace Orchard.Comments.Feeds {
|
||||
|
||||
var limit = 20;
|
||||
var limitValue = context.ValueProvider.GetValue("limit");
|
||||
if (limitValue != null)
|
||||
limit = (int)limitValue.ConvertTo(typeof(int));
|
||||
if (limitValue != null) {
|
||||
Int32.TryParse(Convert.ToString(limitValue), out limit);
|
||||
}
|
||||
|
||||
var comments = _contentManager
|
||||
.Query<CommentPart, CommentPartRecord>()
|
||||
|
@@ -43,8 +43,9 @@ namespace Orchard.Projections.StandardQueries {
|
||||
|
||||
var limitValue = context.ValueProvider.GetValue("limit");
|
||||
var limit = 20;
|
||||
if (limitValue != null)
|
||||
limit = (int)limitValue.ConvertTo(typeof(int));
|
||||
if (limitValue != null) {
|
||||
Int32.TryParse(Convert.ToString(limitValue), out limit);
|
||||
}
|
||||
|
||||
var containerId = (int)projectionId.ConvertTo(typeof(int));
|
||||
var container = _contentManager.Get<ProjectionPart>(containerId);
|
||||
|
Reference in New Issue
Block a user