File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -368,7 +368,6 @@ $.fn.ajaxSubmit = function(options) {
368
368
else if ( s . dataType == 'xml' && ! xhr . responseXML && xhr . responseText != null ) {
369
369
xhr . responseXML = toXml ( xhr . responseText ) ;
370
370
}
371
-
372
371
data = httpData ( xhr , s . dataType , s ) ;
373
372
}
374
373
catch ( e ) {
@@ -438,10 +437,10 @@ $.fn.ajaxSubmit = function(options) {
438
437
// -- custom hack to make the ajax request works with non typed dataType
439
438
// author : Thomas Rabaix <thomas.rabaix@sonata-project.org>
440
439
// account for browsers injecting pre around json response
441
- var matches = xhr . responseText . match ( / ^ ( < p r e > | < b o d y > ) ( .* ) ( < \/ p r e > | < \/ b o d y > ) $ / ) ;
440
+ var matches = xhr . responseText . match ( / ^ ( < p r e ( [ ^ > ] * ) > | < b o d y ( [ ^ > ] * ) > ) ( .* ) ( < \/ p r e > | < \/ b o d y > ) $ / ) ;
442
441
443
- if ( matches . length == 4 ) {
444
- xhr . responseText = matches [ 2 ] ;
442
+ if ( matches && matches . length == 6 ) {
443
+ xhr . responseText = matches [ 4 ] ;
445
444
}
446
445
447
446
if ( xhr . responseText [ 0 ] == '{' ) {
You can’t perform that action at this time.
0 commit comments