2 parents 17e740b + 78eacae commit d5a55bbCopy full SHA for d5a55bb
1 file changed
cmd/tmetric.go
@@ -21,7 +21,7 @@ import (
21
"errors"
22
"fmt"
23
"os"
24
- "strconv"
+ "regexp"
25
"strings"
26
"time"
27
@@ -34,8 +34,8 @@ import (
34
35
func validateOpenProjectWorkPackage(input string) error {
36
if len(input) > 0 {
37
- _, err := strconv.ParseInt(input, 10, 32)
38
- if err != nil {
+ matched, err := regexp.MatchString(`^[a-zA-Z0-9-]+$`, input)
+ if err != nil || !matched {
39
return errors.New("Invalid WP")
40
}
41
0 commit comments