From d3e8bf8da0da3ccd9145d9aec0aa830c437d462d Mon Sep 17 00:00:00 2001 From: cigamit Date: Fri, 19 Jan 2018 15:06:33 -0600 Subject: [PATCH] Revert "Resolving Issue #1239" This reverts commit 33307c2eeeca66c56d309dba0bd1a3b3be974a93. --- docs/CHANGELOG | 1 - include/layout.js | 76 +++++++++++++++++++++++------------------------ 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/docs/CHANGELOG b/docs/CHANGELOG index fab9edf1fd..1c824d8428 100644 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,7 +4,6 @@ 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 e76487c383..82c543f3ef 100644 --- a/include/layout.js +++ b/include/layout.js @@ -1295,47 +1295,47 @@ function loadPageNoHeader(href, scroll) { } function getPresentHTTPError(data) { - if (typeof data != 'undefined') { - var title_match = data.match(/(.*?)<\/title>/); - var head_match = data.match(/<h1>(.*?)<\/h1>/); - var para_match = data.match(/<p>(.*?)<\/p>/); + var title_match = data.match(/<title>(.*?)<\/title>/); + var head_match = data.match(/<h1>(.*?)<\/h1>/); + var para_match = data.match(/<p>(.*?)<\/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 = '<div id="httperror" style="display:none" class="center">' + - '<h4>' + errorOnPage + '</h4><hr>' + - '<h4>' + errorNumberPrefix + ' ' + errorStr + '</h4><hr>' + - '<p><b>' + errorReasonPrefix + '</b> ' + errorText + '</p>' + - '</div>'; - - $('#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 = '<div id="httperror" style="display:none">' + + '<h4>' + errorOnPage + '</h4><hr>' + + '<div style="padding-bottom: 5px;"><div style="display:table-cell;width:75px"><b>' + errorNumberPrefix + '</b></div> ' + + '<div style="display:table-cell"> ' + errorStr + '</div></div>' + + '<div><div style="display:table-cell;width:75px"><b>' + errorReasonPrefix + '</b></div> ' + + '<div style="display:table-cell"> ' + errorText + '</div></div>' + + '</div></div>'; + + $('#httperror').remove(); + $('body').append(returnStr); + $('#httperror').dialog({ + resizable: false, + height: 'auto', + width: 400, + title: errorStr, + buttons: { + Ok: function() { + $(this).dialog('close'); + } + } + }); } function ajaxAnchors() {