Fixes #29793 to allow arbitrary return value length from user-defined /base methods

This commit is contained in:
psterling
2010-12-31 01:26:39 +08:00
parent d3df402d4a
commit feff4a5713

View File

@@ -89,13 +89,18 @@ namespace umbraco.presentation.umbracobase
if (myExtension.isAllowed)
{
string respone = invokeMethod(myExtension, urlArray);
if (respone.Substring(0, 7) == "<error>")
string response = invokeMethod(myExtension, urlArray);
// since return value is arbitrary (set by implementor), check length before checking for error
if (response.Length >= 7)
{
httpApp.Response.StatusCode = 500;
httpApp.Response.StatusDescription = "Internal Server Error";
if (response.Substring(0, 7) == "<error>")
{
httpApp.Response.StatusCode = 500;
httpApp.Response.StatusDescription = "Internal Server Error";
}
}
httpApp.Response.Output.Write(respone);
httpApp.Response.Output.Write(response);
}
else
{