Skip to content

Commit 0c381ca

Browse files
committed
Filter json through html escape sequences
1 parent 422886d commit 0c381ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/templates/EventLog/View.phtml

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ $tpl_metadata_j = @json_decode( $object_metadata );
4949
$tpl_metadata = (
5050
is_null( $object_metadata ) ? '<em>(null)</em>' : (
5151
json_last_error() === JSON_ERROR_NONE ? (
52-
'<pre><code class="wrap">' .
53-
json_encode( $tpl_metadata_j, JSON_PRETTY_PRINT ) .
52+
'<pre><code class="wrap">' . filter_var(
53+
json_encode( $tpl_metadata_j, JSON_PRETTY_PRINT ),
54+
FILTER_SANITIZE_FULL_SPECIAL_CHARS
55+
) .
5456
'</code></pre>'
5557
) : (
5658
'<textarea rows="10" readonly="readonly">' . filter_var(

0 commit comments

Comments
 (0)