Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Ullrich 7 posts 37 karma points
    Feb 22, 2010 @ 19:51
    Martin Ullrich
    0

    ArgumentOutOfRangeException on Bad Requests

    Hi!

    While doing some testing i found out that umbraco (i have 4.0.3) throws an Exception whenever a Page is requested with some "?a=b[whatever]&umbPageId=23343"... seems to be bug in Umbraco..

    Even happens on the official Umbraco Homepage: http://umbraco.org/?a=b&umbPageId=234

    The following error message was generated by umbraco.org server when called with above URL (and is exactly the same message i get):

    Server Error in '/' Application.

    Length cannot be less than zero.
    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: Length cannot be less than zero.
    Parameter name: length

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [ArgumentOutOfRangeException: Length cannot be less than zero.
    Parameter name: length]
    System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +7492983
    umbraco.presentation.requestModule.UmbracoRewrite(Object sender, EventArgs e) +857
    umbraco.presentation.requestModule.Application_PostAuthorizeRequest(Object sender, EventArgs e) +9
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
  • Aaron Powell 1708 posts 3046 karma points c-trib
    Feb 22, 2010 @ 22:54
    Aaron Powell
    100

    The problem is caused because the Umbraco Request module expects that the umbPageId query string value to be the first, not the last. Also, you really shouldn't have a need to use umbPageId as a query string parameter, you should use umbraco.library.NiceUrl to generate the formatted URL for the page.

    You should raise an issue on codeplex but it is a very obscure bug.

    Also, FYI, if you add an additional 5 characters before &umbPageId then you'll not have a problem (see http://umbraco.org/?a=basdas&umbPageId=234)

Please Sign in or register to post replies

Write your reply to:

Draft