搜索功能,如果找不到帖子可以正常显示,找到帖子的页面出错。需要重现的话可以关键字搜索“猫粮”
报错提示如下:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Index and length must refer to a location within the string.
Parameter name: length
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +2916167
Discuz.Data.MySql.DataProvider.CreateSearchCache(SearchCacheInfo cacheinfo) +88
Discuz.Data.MySql.DataProvider.Search(Int32 posttableid, Int32 userid, Int32 usergroupid, String keyword, Int32 posterid, String type, String searchforumid, Int32 keywordtype, Int32 searchtime, Int32 searchtimetype, Int32 resultorder, Int32 resultordertype) +1279
Discuz.Forum.Searches.Search(Int32 posttableid, Int32 userid, Int32 usergroupid, String keyword, Int32 posterid, String type, String searchforumid, Int32 keywordtype, Int32 searchtime, Int32 searchtimetype, Int32 resultorder, Int32 resultordertype) +78
Discuz.ForumPage.search.ShowPage() +1483
Discuz.Web.UI.Pages.BasePage..ctor() +4073
Discuz.ForumPage.search..ctor() +21
ASP.aspx_1_search_aspx..ctor() +10
__ASP.FastObjectFactory_app_web_gdhlkxfz.Create_ASP_aspx_1_search_aspx() +20
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +49
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +115
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +139
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161
未包装的数组越界异常……真丢脸呀……