firstForbiddenCharInParamValue returns the first character in s that is not in [A-Za-z0-9._-], or 0 if all characters are allowed. Used for parameter values (V-MAF-006).
(s string)
| 144 | // [A-Za-z0-9._-], or 0 if all characters are allowed. |
| 145 | // Used for parameter values (V-MAF-006). |
| 146 | func firstForbiddenCharInParamValue(s string) rune { |
| 147 | for _, r := range s { |
| 148 | if !isAlpha(r) && !isDigit(r) && r != '_' && r != '.' && r != '-' { |
| 149 | return r |
| 150 | } |
| 151 | } |
| 152 | return 0 |
| 153 | } |
| 154 | |
| 155 | func isAlpha(r rune) bool { return isLetter(r) } |
| 156 |
no test coverage detected