Skip to content

Commit

Permalink
fix: simplify filecheck breach message
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufhm committed Feb 14, 2024
1 parent aee8cf0 commit 649c4b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pkg/checks/file/filecheck.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package file

import (
"fmt"
"path/filepath"
"strings"

Expand Down Expand Up @@ -66,7 +65,7 @@ func (c *FileCheck) RunCheck() {
return
}
c.AddBreach(&result.ValueBreach{
ValueLabel: fmt.Sprintf("%s - illegal files found", c.Name),
Value: strings.Join(files, "\n"),
ValueLabel: "illegal files found",
Value: strings.Join(files, ","),
})
}
4 changes: 2 additions & 2 deletions pkg/checks/file/filecheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func TestFileCheckRunCheck(t *testing.T) {
CheckType: "file",
CheckName: "filecheck2",
Severity: "normal",
ValueLabel: "filecheck2 - illegal files found",
Value: "testdata/adminer.php\ntestdata/sub/phpmyadmin.php",
ValueLabel: "illegal files found",
Value: "testdata/adminer.php,testdata/sub/phpmyadmin.php",
},
},
c.Result.Breaches,
Expand Down

0 comments on commit 649c4b8

Please sign in to comment.