mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Fix incorrect parsing of HTML content
This commit is contained in:
parent
55dca6eec6
commit
69de7e3fce
@ -585,11 +585,14 @@ jQuery.noConflict();
|
||||
|
||||
var newFragments = {}, newContentEls;
|
||||
// If content type is text/json (ignoring charset and other parameters)
|
||||
if(xhr.getResponseHeader('Content-Type').match(/^text\/json[ \t]*;?/i)) {
|
||||
if(xhr.getResponseHeader('Content-Type').match(/^((text)|(application))\/json[ \t]*;?/i)) {
|
||||
newFragments = data;
|
||||
} else {
|
||||
|
||||
// Fall back to replacing the content fragment if HTML is returned
|
||||
$data = $(data);
|
||||
var fragment = document.createDocumentFragment();
|
||||
jQuery.clean( [ data ], document, fragment, [] );
|
||||
$data = $(jQuery.merge( [], fragment.childNodes ));
|
||||
|
||||
// Try and guess the fragment if none is provided
|
||||
// TODO: data-pjax-fragment might actually give us the fragment. For now we just check most common case
|
||||
|
Loading…
Reference in New Issue
Block a user