File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 * This file is copyright under the latest version of the EUPL.
66 * Please see LICENSE file for your rights under this license. */
77
8- /* global apiFailure:false */
8+ /* global apiFailure:false, utils:false */
99
1010"use strict" ;
1111
@@ -89,9 +89,11 @@ function parseLines(outputElement, text) {
8989 const lines = text . split ( / (? = \r ) / g) ;
9090
9191 for ( let line of lines ) {
92+ // Escape HTML to prevent XSS attacks (both in adlist URL and non-domain entries)
93+ line = utils . escapeHtml ( line ) ;
9294 if ( line [ 0 ] === "\r" ) {
9395 // This line starts with the "OVER" sequence. Replace them with "\n" before print
94- line = line . replaceAll ( "\r[K" , "\n" ) . replaceAll ( "\r" , "\n" ) ;
96+ line = line . replaceAll ( "\r\u001B [K" , "\n" ) . replaceAll ( "\r" , "\n" ) ;
9597
9698 // Last line from the textarea will be overwritten, so we remove it
9799 const lastLineIndex = outputElement . innerHTML . lastIndexOf ( "\n" ) ;
You can’t perform that action at this time.
0 commit comments