Skip to content

ScriptResource.axd failing when querystring ends in 'id=' #2447

Description

@CMarius94

Description of bug

When the querystring looks like this: ?asid=2&rrid=3&apid= the ScriptResource.axd is failing in browser console when loading the page.

Steps to reproduce

List the steps to reproduce the behavior:

  1. Go to any page with a querystring that ends in id=
  2. Open the browser console
  3. Find the error from ScriptResource.axd
  4. Go to "Elements" and see the DOM of the page
  5. Find <form method="Post" .. > just under <body id="Body" ..> (practically, the form of the page)
  6. Notice the form element looking like this: <form method="post" action="/en-us/Assessments/Take-Assessment?asid=10&irid=15&rmp=3&rrid=&apid=" form"form" enctype="multipart/form-data">. More exactly the form"form" part of the element

Current result

The ScriptResource.axd is failing on page load

Expected result

ScriptResource.axd should not fail at all

Error log

ScriptResource.axd?d=dwY9oWetJoJH6VDixRd9vbR8SwZy4wNKeD7WpUnb1wycGcrgcxyAQS2LVTBDmSyxj3SeWUuKCvRebU6-MuqhUfqd8S_jjEGzGCfLBklfOh8hHBG0zgjvbtHzfJnwbrLQb1aF97PzFVnD9MPv0&t=ffffffffad4b7194:5 Uncaught TypeError: Cannot read property 'onsubmit' of null at Sys.WebForms.PageRequestManager._initializeInternal (ScriptResource.axd?d=dwY9oWetJoJH6VDixRd9vbR8SwZy4wNKeD7WpUnb1wycGcrgcxyAQS2LVTBDmSyxj3SeWUuKCvRebU6-MuqhUfqd8S_jjEGzGCfLBklfOh8hHBG0zgjvbtHzfJnwbrLQb1aF97PzFVnD9MPv0&t=ffffffffad4b7194:5) at Function.Sys.WebForms.PageRequestManager._initialize (ScriptResource.axd?d=dwY9oWetJoJH6VDixRd9vbR8SwZy4wNKeD7WpUnb1wycGcrgcxyAQS2LVTBDmSyxj3SeWUuKCvRebU6-MuqhUfqd8S_jjEGzGCfLBklfOh8hHBG0zgjvbtHzfJnwbrLQb1aF97PzFVnD9MPv0&t=ffffffffad4b7194:5) at Take-Assessment?asid=10&irid=15&rmp=3&rrid=&apid=:567

Additional context

Looking through the source where this might happen, i have found the code in class DotNetNuke.Common.Controls.Form in the file ActionLessForm.cs where the Form control id is rewritten in an old way which is based on finding the string id=" on the line 54.
See the ActionLessForm.cs code

Affected version

  • 9.2.2
  • 9.2.1
  • 9.2
  • 9.1.1
  • 9.1
  • 9.0

Tested only with 9.2.2 but seeing the blame makes me think that this might occur on older versions too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions