mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 05:20:56 +02:00
[ticket/13771] Only handle valid JQHXR response objects
PHPBB3-13771
This commit is contained in:
@@ -262,10 +262,13 @@ phpbb.ajaxify = function(options) {
|
|||||||
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
|
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
|
||||||
}
|
}
|
||||||
phpbb.clearLoadingTimeout();
|
phpbb.clearLoadingTimeout();
|
||||||
var errorText = false;
|
var responseText, errorText = false;
|
||||||
var responseText = $.parseJSON(jqXHR.responseText);
|
try {
|
||||||
if (typeof responseText.message === 'string' && responseText.message.length > 0) {
|
responseText = JSON.parse(jqXHR.responseText);
|
||||||
errorText = responseText.message;
|
responseText = responseText.message;
|
||||||
|
} catch (e) {}
|
||||||
|
if (typeof responseText === 'string' && responseText.length > 0) {
|
||||||
|
errorText = responseText;
|
||||||
}
|
}
|
||||||
else if (typeof errorThrown === 'string' && errorThrown.length > 0) {
|
else if (typeof errorThrown === 'string' && errorThrown.length > 0) {
|
||||||
errorText = errorThrown;
|
errorText = errorThrown;
|
||||||
|
Reference in New Issue
Block a user