diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 1c824d8428..fab9edf1fd 100644 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,7 @@ Cacti CHANGELOG -issue#1222: Fix RRDTool error in generate_graph_def_name() -issue#1230: Fix undefined function in tree.php -issue#1238: Cacti not handing git pull 'Invalid Object identifier' correctly +-issue#1239: New Cacti browser error handler mishandling certain conditions -issue: Critial issue created when theme files are missing corrupting user settings 1.1.31 diff --git a/include/layout.js b/include/layout.js index 82c543f3ef..9e1dfd205f 100644 --- a/include/layout.js +++ b/include/layout.js @@ -1295,47 +1295,49 @@ function loadPageNoHeader(href, scroll) { } function getPresentHTTPError(data) { - var title_match = data.match(/
(.*?)<\/p>/); + if (typeof data != 'undefined') { + var title_match = data.match(/
(.*?)<\/p>/); - errorStr = ''; - errorSub = ''; - errorText = ''; + errorStr = ''; + errorSub = ''; + errorText = ''; - if (title_match != null) { - var errorStr = title_match[1]; - } - - if (head_match != null) { - var errorSub = head_match[1]; - } - - if (para_match != null) { - var errorText = para_match[1]; - } - - returnStr = '
'; - - $('#httperror').remove(); - $('body').append(returnStr); - $('#httperror').dialog({ - resizable: false, - height: 'auto', - width: 400, - title: errorStr, - buttons: { - Ok: function() { - $(this).dialog('close'); - } + if (title_match != null) { + var errorStr = title_match[1]; } - }); + + if (head_match != null) { + var errorSub = head_match[1]; + } + + if (para_match != null) { + var errorText = para_match[1]; + } + + returnStr = ''; + + $('#httperror').remove(); + $('body').append(returnStr); + $('#httperror').dialog({ + resizable: false, + height: 'auto', + width: 400, + title: errorStr, + buttons: { + Ok: function() { + $(this).dialog('close'); + } + } + }); + } } function ajaxAnchors() {