Skip to content

Commit a6fa9b8

Browse files
committed
Escape message/code of compile logs and adapt filename in build website
Both was missing in - #3610
1 parent 8e192d9 commit a6fa9b8

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

scripts/releng/CompilerSummaryGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/** @author Dean Roberts (circa 2000!) and David Williams (circa 2016) */
3434

3535
final String XML_EXTENSION = ".xml";
36-
final String COMPILER_SUMMARY_FILENAME = "compilerSummary.json";
36+
final String COMPILER_SUMMARY_FILENAME = "logs.json";
3737

3838
Path compileLogsDirectory; // Location of compile logs base directory
3939

sites/eclipse/build/tests.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,13 @@ <h3 id="compiler-issues">Plugins containing compile warnings or infos</h3>
186186
severity = problem.getAttribute('severity')
187187
const problemID = problem.getAttribute('id')
188188
const line = parseInt(problem.getAttribute('line'))
189-
const message = problem.querySelector('message').getAttribute('value')
189+
const message = escapeHTML(problem.querySelector('message').getAttribute('value'))
190190
const contextValue = problem.querySelector('source_context').getAttribute('value')
191191
const sourceStart = parseInt(problem.querySelector('source_context').getAttribute('sourceStart'))
192192
const sourceEnd = parseInt(problem.querySelector('source_context').getAttribute('sourceEnd')) + 1
193-
const sourceCodeBefore = contextValue.substring(0, sourceStart)
194-
const sourceCode = contextValue.substring(sourceStart, sourceEnd);
195-
const sourceCodeAfter = contextValue.substring(sourceEnd, contextValue.length);
193+
const sourceCodeBefore = escapeHTML(contextValue.substring(0, sourceStart))
194+
const sourceCode = escapeHTML(contextValue.substring(sourceStart, sourceEnd))
195+
const sourceCodeAfter = escapeHTML(contextValue.substring(sourceEnd, contextValue.length))
196196
if (isMatchingIssue(issueType, severity, problemID)) {
197197
elements += `
198198
<tr class="no-zebra-striping">

sites/eclipse/page.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,13 @@ function prependChildren(element, id, ...children) {
558558
return element;
559559
}
560560

561+
function escapeHTML(rawString) {
562+
return rawString
563+
.replace(/&/g, '&amp;')
564+
.replace(/</g, '&lt;')
565+
.replace(/>/g, '&gt;')
566+
}
567+
561568
// Collapsibles/accordion tables
562569

563570
let _eventListenersAdded = false

0 commit comments

Comments
 (0)