File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
log_viewer/templates/log_viewer Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,22 @@ <h1 class="pull-left">{% if custom_file_list_title %}{{ custom_file_list_title }
6060 </ div >
6161
6262 < script >
63+ var entityMap = {
64+ '&' : '&' ,
65+ '<' : '<' ,
66+ '>' : '>' ,
67+ '"' : '"' ,
68+ "'" : ''' ,
69+ '/' : '/' ,
70+ '`' : '`' ,
71+ '=' : '='
72+ } ;
73+ function escapeHtml ( string ) {
74+ return String ( string ) . replace ( / [ & < > " ' ` = \/ ] / g, function fromEntityMap ( s ) {
75+ return entityMap [ s ] ;
76+ } ) ;
77+ }
78+
6379 function loadDataTable ( table_name , url_json ) {
6480 $ ( table_name ) . DataTable ( {
6581 pageLength : { { page_length } } ,
@@ -73,7 +89,8 @@ <h1 class="pull-left">{% if custom_file_list_title %}{{ custom_file_list_title }
7389 var next_page = response . next_page || 1 ;
7490
7591 response . logs . forEach ( function ( text , numb , logs ) {
76- new_logs . push ( [ numb + 1 , text ] )
92+ text = escapeHtml ( text ) ;
93+ new_logs . push ( [ numb + 1 , text ] ) ;
7794 } ) ;
7895
7996 callback ( {
You can’t perform that action at this time.
0 commit comments