diff --git a/src/www/interfaces.php b/src/www/interfaces.php index 1702e1755..fec555525 100644 --- a/src/www/interfaces.php +++ b/src/www/interfaces.php @@ -1400,7 +1400,7 @@ include("head.inc"); type: 'post', data: 'isAjax=true&ipprotocol=inet' + defaultgw + '&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip), error: function(request, textStatus, errorThrown){ - if (textStatus === "error" && request.getResponseHeader("Content-Type") === "text/plain") { + if (textStatus === "error" && request.getResponseHeader("Content-Type").indexOf("text/plain") === 0) { alert(request.responseText); } else { alert("Sorry, we could not create your IPv4 gateway at this time."); @@ -1433,7 +1433,7 @@ include("head.inc"); type: 'post', data: 'isAjax=true&ipprotocol=inet6' + defaultgw + '&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip), error: function(request, textStatus, errorThrown){ - if (textStatus === "error" && request.getResponseHeader("Content-Type") === "text/plain") { + if (textStatus === "error" && request.getResponseHeader("Content-Type").indexOf("text/plain") === 0) { alert(request.responseText); } else { alert("Sorry, we could not create your IPv6 gateway at this time."); diff --git a/src/www/system_gateways_edit.php b/src/www/system_gateways_edit.php index d3306f92d..95ce65b38 100644 --- a/src/www/system_gateways_edit.php +++ b/src/www/system_gateways_edit.php @@ -437,9 +437,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!empty($_REQUEST['isAjax'])) { header("HTTP/1.0 500 Internal Server Error"); header("Content-type: text/plain"); - foreach ($input_errors as $error) { - echo("$error\n"); - } + echo implode("\n\n", $input_errors); exit; }