File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import (
18
18
// RequestValues hold form values from a validated Request
19
19
type RequestValues map [string ]string
20
20
21
- // CallDuration Parses the duration rom the string value
21
+ // CallDuration Parses the duration from the string value
22
22
func (r RequestValues ) CallDuration () (int , error ) {
23
23
var duration int
24
24
if r ["CallDuration" ] != "" {
@@ -156,5 +156,5 @@ var fieldValidators = map[string]valCfg{
156
156
// "SipUsername": "SipUsername",
157
157
// "SipCallId": "SipCallId",
158
158
// "SipSourceIp": "SipSourceIp",
159
- "Digits" : valCfg {valFunc : validNumeric },
159
+ "Digits" : valCfg {valFunc : validateKeyPadEntry },
160
160
}
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ func validatePhoneNumber(num string) error {
44
44
return nil
45
45
}
46
46
47
- func validNumeric (v interface {}, param string ) error {
47
+ func validateKeyPadEntry (v interface {}, param string ) error {
48
48
switch num := v .(type ) {
49
49
case string :
50
50
if num == "" {
@@ -53,22 +53,22 @@ func validNumeric(v interface{}, param string) error {
53
53
}
54
54
return errors .New ("Required" )
55
55
}
56
- return validateNumeric (num )
56
+ return validateNumericPoundStar (num )
57
57
case * string :
58
58
if num == nil {
59
59
if param == "allowempty" {
60
60
return nil
61
61
}
62
62
return errors .New ("Required" )
63
63
}
64
- return validateNumeric (* num )
64
+ return validateNumericPoundStar (* num )
65
65
default :
66
66
return fmt .Errorf ("validDatastoreKey: Unexpected type %T" , num )
67
67
}
68
68
}
69
69
70
- func validateNumeric (v string ) error {
71
- return characterList (v , "0123456789" )
70
+ func validateNumericPoundStar (v string ) error {
71
+ return characterList (v , "0123456789#* " )
72
72
}
73
73
74
74
// characterList checks a string against a list of acceptable characters.
You can’t perform that action at this time.
0 commit comments