summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-09 10:49:29 +0300
committerValery Piashchynski <[email protected]>2021-06-09 10:49:29 +0300
commitbf1e14fe15af995355d91d658c085a315e139e24 (patch)
tree547dadc010b8d4a5265f264175953a4d1f840234
parent8020cbb83afbaaf4ea4e0321b1b6c24d38332887 (diff)
- Update regex
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r--plugins/server/command.go2
-rw-r--r--plugins/server/command_test.go7
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/server/command.go b/plugins/server/command.go
index a3752e7b..e0b61896 100644
--- a/plugins/server/command.go
+++ b/plugins/server/command.go
@@ -8,7 +8,7 @@ import (
)
// pattern for the path finding
-const pattern string = `^\/*([A-z0-9/.:-]+\.(php|sh|ph))$`
+const pattern string = `^\/*([A-z/.:-]+\.(php|sh|ph))$`
func (server *Plugin) scanCommand(cmd []string) error {
const op = errors.Op("server_command_scan")
diff --git a/plugins/server/command_test.go b/plugins/server/command_test.go
index d226ae9c..74762ccd 100644
--- a/plugins/server/command_test.go
+++ b/plugins/server/command_test.go
@@ -33,4 +33,11 @@ func TestServerCommandChecker(t *testing.T) {
if !errors.Is(errors.FileNotFound, err) {
t.Fatal("should be of filenotfound type")
}
+
+ cmd6 := "php 0/../../tests/cluent.php --option1 --option2"
+ err = s.scanCommand(strings.Split(cmd6, " "))
+ assert.Error(t, err)
+ if errors.Is(errors.FileNotFound, err) {
+ t.Fatal("should be of filenotfound type")
+ }
}