mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-15 18:48:14 +02:00
normalized negative multipart/form-data numeric inferred value check
This commit is contained in:
1 parent
274d499279
commit
cb0335c2b6
2 files changed
+4
-2
No files matched your search
@@ -325,7 +325,8 @@ func inferValue(raw string) any {
|
||||
// try to convert to number
|
||||
//
|
||||
// note: expects the provided raw string to match exactly with the minimal string representation of the parsed float
|
||||
if raw[0] == '-' || (raw[0] >= '0' && raw[0] <= '9') && inferNumberCharsRegex.Match([]byte(raw)) {
|
||||
if (raw[0] == '-' || (raw[0] >= '0' && raw[0] <= '9')) &&
|
||||
inferNumberCharsRegex.Match([]byte(raw)) {
|
||||
v, err := strconv.ParseFloat(raw, 64)
|
||||
if err == nil && strconv.FormatFloat(v, 'f', -1, 64) == raw {
|
||||
return v
|
||||
|
||||
Reference in new issue
Block a user