Correctly display HTML entities in event log (#4566)
This changes the event log to use a partial for the log message which double-encodes the data. When using formatted view in the log viewer widget, the HTML entites are allowed by decoding back a step. When in raw view, the HTML entities are kept double-encoded. Fixes #4558.
This commit is contained in:
parent
e19f20bcb7
commit
a53cc52752
|
|
@ -40,7 +40,7 @@
|
|||
}
|
||||
})
|
||||
|
||||
markup = self.parseSource(self.$el.text())
|
||||
markup = self.parseSource(self.$el.html())
|
||||
|
||||
self.$el
|
||||
.addClass('plugin-exception-beautifier')
|
||||
|
|
@ -274,7 +274,10 @@
|
|||
}
|
||||
}
|
||||
else {
|
||||
markup += $.oc.escapeHtmlString(str)
|
||||
// Allow HTML entities
|
||||
str = str.replace(/&([^\s&;]+?);/g, '&$1;')
|
||||
|
||||
markup += str
|
||||
.replace(/\{x-newline\}/g, '<br>')
|
||||
.replace(/\{x-tabulation\}/g, ' ')
|
||||
}
|
||||
|
|
@ -353,7 +356,7 @@
|
|||
tabs.find('#beautifier-tab-formatted').append(markup)
|
||||
}
|
||||
|
||||
tabs.find('#beautifier-tab-raw').append('<div class="beautifier-raw-content">' + $.oc.escapeHtmlString(source.trim()).replace(/\r\n|\r|\n/g, '<br>').replace(/ {2}/g, ' ') + '</div>')
|
||||
tabs.find('#beautifier-tab-raw').append('<div class="beautifier-raw-content">' + source.trim().replace(/\r\n|\r|\n/g, '<br>').replace(/ {2}/g, ' ') + '</div>')
|
||||
|
||||
tabs.ocTab({
|
||||
closable: false
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
<?= e($value, true); ?>
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
fields:
|
||||
|
||||
message:
|
||||
type: textarea
|
||||
type: partial
|
||||
path: field_message
|
||||
containerAttributes:
|
||||
data-plugin: exception-beautifier
|
||||
|
|
|
|||
Loading…
Reference in New Issue