Skip to content

Commit

Permalink
Updating output due to theme support.
Browse files Browse the repository at this point in the history
  • Loading branch information
gudmdharalds committed Sep 8, 2022
1 parent cb9fccb commit e713e83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tests/unit/WpscanReportCommentFormatResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testReportResultPlugin(): void {
'security' => VIPGOCI_WPSCAN_OBSOLETE,
'message' => 'My Plugin',
'details' => array(
'plugin_uri' => 'https://wordpress.org/plugins/my-plugin',
'uri' => 'https://wordpress.org/plugins/my-plugin',
'installed_location' => 'plugins/my-plugin',
'version_detected' => '1.0.0',
'latest_version' => '2.0.0',
Expand Down Expand Up @@ -188,7 +188,7 @@ public function testReportResultTheme(): void {
'security' => VIPGOCI_WPSCAN_VULNERABLE,
'message' => 'My Theme',
'details' => array(
'theme_uri' => 'https://wordpress.org/themes/my-theme',
'uri' => 'https://wordpress.org/themes/my-theme',
'installed_location' => 'themes/my-theme',
'version_detected' => '1.0.0',
'latest_version' => '2.0.0',
Expand Down Expand Up @@ -322,15 +322,15 @@ public function testReportResultSecurityTypeInvalid(): void {

ob_start();

$report_str = vipgoci_wpscan_report_comment_format_result(
vipgoci_wpscan_report_comment_format_result(
'repo_owner',
'repo_name',
'commit12345id',
array(
'security' => 'invalid', // Invalid.
'message' => 'My Theme',
'details' => array(
'theme_uri' => 'https://wordpress.org/themes/my-theme',
'uri' => 'https://wordpress.org/themes/my-theme',
'installed_location' => 'themes/my-theme',
'version_detected' => '1.0.0',
'latest_version' => '2.0.0',
Expand Down Expand Up @@ -376,15 +376,15 @@ public function testReportResultIssueTypeInvalid(): void {

ob_start();

$report_str = vipgoci_wpscan_report_comment_format_result(
vipgoci_wpscan_report_comment_format_result(
'repo_owner',
'repo_name',
'commit12345id',
array(
'security' => VIPGOCI_WPSCAN_OBSOLETE,
'message' => 'My Theme',
'details' => array(
'theme_uri' => 'https://wordpress.org/themes/my-theme',
'uri' => 'https://wordpress.org/themes/my-theme',
'installed_location' => 'themes/my-theme',
'version_detected' => '1.0.0',
'latest_version' => '2.0.0',
Expand Down
6 changes: 3 additions & 3 deletions wpscan-reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ function vipgoci_wpscan_report_comment_format_result(
if ( VIPGOCI_WPSCAN_PLUGIN === $issue_type ) {
$res .= ' Plugin information' . "\n" .
'**Plugin Name**: ' . vipgoci_output_html_escape( $issue['message'] ) . "\n" .
'**Plugin URI**: ' . vipgoci_output_html_escape( $issue['details']['plugin_uri'] ) . "\n";
'**Plugin URI**: ' . vipgoci_output_html_escape( $issue['details']['uri'] ) . "\n";
} elseif ( VIPGOCI_WPSCAN_THEME === $issue_type ) {
$res .= ' Theme information' . "\n" .
'**Theme Name**: ' . vipgoci_output_html_escape( $issue['message'] ) . "\n" .
'**Theme URI**: ' . vipgoci_output_html_escape( $issue['details']['theme_uri'] ) . "\n";
'**Theme URI**: ' . vipgoci_output_html_escape( $issue['details']['uri'] ) . "\n";
} else {
vipgoci_sysexit(
'Internal error: Invalid $issue_type in ' . __FUNCTION__,
Expand Down Expand Up @@ -179,7 +179,7 @@ function vipgoci_wpscan_report_comment_format_result(
'msg' => $issue['message'],
'level' => $issue['security'],
'version' => $issue['details']['version_detected'],
'latest' => $issue['details']['latest_version']
'latest' => $issue['details']['latest_version'],
),
0,
true
Expand Down

0 comments on commit e713e83

Please sign in to comment.