mirror of
https://github.com/jquery/jquery.git
synced 2026-02-06 08:24:59 -05:00
Makes parseXML act like parseJSON when given an empty or non-string input: now returns null rather than throwing an exception. Incidently fixes #10527. Unit tests added.
This commit is contained in:
@@ -557,6 +557,9 @@ jQuery.extend({
|
||||
|
||||
// Cross-browser xml parsing
|
||||
parseXML: function( data ) {
|
||||
if ( typeof data !== "string" || !data ) {
|
||||
return null;
|
||||
}
|
||||
var xml, tmp;
|
||||
try {
|
||||
if ( window.DOMParser ) { // Standard
|
||||
|
||||
Reference in New Issue
Block a user