mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing the search page w/ no query
--HG-- branch : dev
This commit is contained in:
@@ -40,11 +40,10 @@ namespace Orchard.Search.Controllers {
|
|||||||
|
|
||||||
protected virtual ISite CurrentSite { get; [UsedImplicitly] private set; }
|
protected virtual ISite CurrentSite { get; [UsedImplicitly] private set; }
|
||||||
|
|
||||||
public ActionResult Index(string q, Pager pager) {
|
public ActionResult Index(Pager pager, string q = "") {
|
||||||
var searchFields = CurrentSite.As<SearchSettingsPart>().SearchedFields;
|
var searchFields = CurrentSite.As<SearchSettingsPart>().SearchedFields;
|
||||||
|
|
||||||
IPageOfItems<ISearchHit> searchHits;
|
IPageOfItems<ISearchHit> searchHits;
|
||||||
|
|
||||||
if (q.Trim().StartsWith("?") || q.Trim().StartsWith("*")) {
|
if (q.Trim().StartsWith("?") || q.Trim().StartsWith("*")) {
|
||||||
searchHits = new PageOfItems<ISearchHit>(new ISearchHit[] { });
|
searchHits = new PageOfItems<ISearchHit>(new ISearchHit[] { });
|
||||||
Services.Notifier.Error(T("'*' or '?' not allowed as first character in WildcardQuery"));
|
Services.Notifier.Error(T("'*' or '?' not allowed as first character in WildcardQuery"));
|
||||||
|
Reference in New Issue
Block a user