mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/13771] Only handle valid JQHXR response objects
PHPBB3-13771
This commit is contained in:
parent
4a7f905c6a
commit
c7a0b4479d
1 changed files with 7 additions and 4 deletions
|
@ -262,10 +262,13 @@ phpbb.ajaxify = function(options) {
|
|||
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
|
||||
}
|
||||
phpbb.clearLoadingTimeout();
|
||||
var errorText = false;
|
||||
var responseText = $.parseJSON(jqXHR.responseText);
|
||||
if (typeof responseText.message === 'string' && responseText.message.length > 0) {
|
||||
errorText = responseText.message;
|
||||
var responseText, errorText = false;
|
||||
try {
|
||||
responseText = JSON.parse(jqXHR.responseText);
|
||||
responseText = responseText.message;
|
||||
} catch (e) {}
|
||||
if (typeof responseText === 'string' && responseText.length > 0) {
|
||||
errorText = responseText;
|
||||
}
|
||||
else if (typeof errorThrown === 'string' && errorThrown.length > 0) {
|
||||
errorText = errorThrown;
|
||||
|
|
Loading…
Add table
Reference in a new issue