Skip to content

Commit aea44a5

Browse files
authored
Apply XSS fix
Apply the change made in this PR to 1.3 branch: jquery-archive#8649
1 parent e1b18df commit aea44a5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: js/jquery.mobile.navigation.js

+11
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,17 @@ define( [
515515
contentType: settings.contentType,
516516
dataType: "html",
517517
success: function( html, textStatus, xhr ) {
518+
519+
// Applying this change: https://github.com/jquery/jquery-mobile/commit/b0d9cc758a48f13321750d7409fb7655dcdf2b50
520+
if (!/^text\/html\b/.test(xhr.getResponseHeader('Content-Type'))) {
521+
// Display error message for unsupported content type
522+
if (settings.showLoadMsg) {
523+
// show error message
524+
$.mobile.showPageLoadingMsg($.mobile.pageLoadErrorMessageTheme, $.mobile.pageLoadErrorMessage, true);
525+
}
526+
return;
527+
}
528+
518529
//pre-parse html to check for a data-url,
519530
//use it as the new fileUrl, base path, etc
520531
var all = $( "<div></div>" ),

0 commit comments

Comments
 (0)