loader.js: Avoid named capture groups to parse multipart content
fixes #3975
This commit is contained in:
parent
52d830170f
commit
2896cbd781
|
@ -558,15 +558,15 @@
|
||||||
var contentSeparator = req.getResponseHeader('X-Icinga-Multipart-Content');
|
var contentSeparator = req.getResponseHeader('X-Icinga-Multipart-Content');
|
||||||
if (!! contentSeparator) {
|
if (!! contentSeparator) {
|
||||||
$.each(req.responseText.split(contentSeparator), function (idx, el) {
|
$.each(req.responseText.split(contentSeparator), function (idx, el) {
|
||||||
var match = el.match(/for=(?<id>\S+)\s+(?<html>.*)/m);
|
var match = el.match(/for=(\S+)\s+(.*)/m);
|
||||||
if (!! match) {
|
if (!! match) {
|
||||||
var $target = $('#' + match.groups.id);
|
var $target = $('#' + match[1]);
|
||||||
if ($target.length) {
|
if ($target.length) {
|
||||||
_this.renderContentToContainer(
|
_this.renderContentToContainer(
|
||||||
match.groups.html, $target, 'replace', req.autorefresh, req.forceFocus, autoSubmit);
|
match[2], $target, 'replace', req.autorefresh, req.forceFocus, autoSubmit);
|
||||||
} else {
|
} else {
|
||||||
_this.icinga.logger.warn(
|
_this.icinga.logger.warn(
|
||||||
'Invalid target ID. Cannot render multipart to #' + match.groups.id);
|
'Invalid target ID. Cannot render multipart to #' + match[1]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_this.icinga.logger.error('Ill-formed multipart', el);
|
_this.icinga.logger.error('Ill-formed multipart', el);
|
||||||
|
|
Loading…
Reference in New Issue