diff --git a/auto-approval.php b/auto-approval.php
index d34300c6..a6172a5a 100644
--- a/auto-approval.php
+++ b/auto-approval.php
@@ -127,7 +127,7 @@ function vipgoci_auto_approval_non_approval(
$options['repo-name'],
(int) $pr_number,
(int) $pr_item_review->id,
- 'Dismissing obsolete review; not approved any longer',
+ vipgoci_output_html_escape( 'Dismissing obsolete review; not approved any longer' ),
$options['token']
);
}
diff --git a/github-api.php b/github-api.php
index f4c8a7a5..99f3067f 100644
--- a/github-api.php
+++ b/github-api.php
@@ -1292,8 +1292,7 @@ function vipgoci_github_pr_reviews_dismiss_with_non_active_comments(
$options['repo-name'],
$pr_number,
$pr_review->id,
- 'Dismissing review as all inline comments ' .
- 'are obsolete by now',
+ 'Dismissing review as all inline comments are obsolete by now',
$options['token']
);
}
diff --git a/reports.php b/reports.php
index efc209f5..15530649 100644
--- a/reports.php
+++ b/reports.php
@@ -101,7 +101,7 @@ function vipgoci_report_create_scan_details_software_versions(
$details .= '
' . PHP_EOL;
- $details .= '- vip-go-ci version:
' . vipgoci_output_sanitize_version_number( VIPGOCI_VERSION ) . '
' . PHP_EOL;
+ $details .= '- vip-go-ci version:
' . vipgoci_output_sanitize_version_number( VIPGOCI_VERSION ) . '
' . PHP_EOL;
$php_runtime_version = phpversion();
@@ -649,6 +649,8 @@ function vipgoci_report_maybe_no_issues_found(
$no_issues_msg .= ' (commit-ID: ' . $commit_id . ')';
+ $no_issues_msg = vipgoci_output_html_escape( $no_issues_msg );
+
/*
* If we have informational message, append it.
*/
@@ -1440,7 +1442,7 @@ function vipgoci_report_submit_pr_review_from_results(
$repo_name,
$github_token,
$pr_number,
- VIPGOCI_GITHUB_ERROR_STR,
+ vipgoci_output_html_escape( VIPGOCI_GITHUB_ERROR_STR ),
$commit_id
);
}
diff --git a/svg-scan.php b/svg-scan.php
index 8f77bf39..055d4664 100644
--- a/svg-scan.php
+++ b/svg-scan.php
@@ -145,7 +145,7 @@ function vipgoci_svg_look_for_specific_tokens(
$results['files'][ $temp_file_name ]['messages'][] =
array(
- 'message' => 'Found forbidden tag in SVG file: \'' . $disallowed_token . '\'',
+ 'message' => vipgoci_output_html_escape( 'Found forbidden tag in SVG file: \'' . $disallowed_token . '\'' ),
'line' => $line_no,
'level' => 'ERROR',
);
diff --git a/tests/integration/SvgScanLookForSpecificTokensTest.php b/tests/integration/SvgScanLookForSpecificTokensTest.php
index 6f871a1d..1d80faaa 100644
--- a/tests/integration/SvgScanLookForSpecificTokensTest.php
+++ b/tests/integration/SvgScanLookForSpecificTokensTest.php
@@ -72,7 +72,7 @@ public function testSpecificTokens1() {
);
$results_expected = json_decode(
- '{"totals":{"errors":1,"warnings":0,"fixable":0},"files":{"' . addcslashes( $temp_file_name, '/' ) . '":{"errors":1,"messages":[{"message":"Found forbidden tag in SVG file: \'assertStringContainsString(
- '- vip-go-ci version:
' . VIPGOCI_VERSION . '
',
+ '- vip-go-ci version:
' . VIPGOCI_VERSION . '
',
$actual_output
);
@@ -150,7 +150,7 @@ public function testCreateDetails2(): void {
);
$this->assertStringContainsString(
- '- vip-go-ci version:
' . VIPGOCI_VERSION . '
',
+ '- vip-go-ci version:
' . VIPGOCI_VERSION . '
',
$actual_output
);