Bug Tracker

Modify

Ticket #6378 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

An error is thrown if the returned document is expected to be valid XML but it is not.

Reported by: tw2080 Owned by:
Priority: undecided Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: Cc:
Blocking: Blocked by:

Description

Additinal check is required to chatch if data.documentElement == null before data.documentElement.nodeName is checked.

Function httpData, line 5351 should be: if ( xml && data.documentElement && data.documentElement.nodeName === "parsererror" ) {

Change History

comment:1 Changed 3 years ago by addyosmani

  • need changed from Review to Test Case
  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to invalid

Here are two code examples, one using valid XML and another using invalid XML. Both are using 1.4.2 in it's current form:

Valid XML:  http://www.addyosmani.com/jquery/6378/index.html Invalid XML:  http://www.addyosmani.com/jquery/6378/index2.html

Here is the invalid XML example with your change integrated in the jQuery build included as per your suggestion:

 http://www.addyosmani.com/jquery/6378/index3.html

and here's another test similar to the above with a blank XML file used as opposed to just valid input.

 http://www.addyosmani.com/jquery/6378/index4.html

What I'm seeing in terms of error output is exactly the same regardless of whether we're using the current lines at 5351 or the lines with your changes included. With this in mind, a developer would be able to sufficiently handle the data returned with additional error checks on the front-end if needed.

Could you please re-open the ticket or re-submit with a detailed explanation and code example to demonstrate why your proposal should be integrated and what benefit it would offer?

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.