You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We ran into an unexpected issue with our Ozzo validation code (which was allowing January 1st, Year 1 to bypass our date validation).
Please see snippet below - is this a case of user error, or bug?
package main
import (
"fmt"
ozzo_validation "github.com/go-ozzo/ozzo-validation/v4"
"time"
)
func main() {
// This date shouldn't pass validation! But it does >_<
//
// dob in this case is less than minDob
dob := time.Date(1, time.Month(1), 1, 0, 0, 0, 0, time.UTC)
minDob := ozzo_validation.Min(time.Date(1900, 1, 1, 0, 0, 0, 0, time.UTC))
if err := ozzo_validation.Validate(
dob,
minDob,
); err != nil {
fmt.Println(err)
} else {
fmt.Println("No failures!")
}
}
It appears to be specific to a dob value of time.Date(1, time.Month(1), 1, 0, 0, 0, 0, time.UTC)
If we add at least one nanosecond to DOB value of January 1st, Year 1 - Ozzo Validation correctly rejects invalid date
The text was updated successfully, but these errors were encountered:
Hello,
We ran into an unexpected issue with our Ozzo validation code (which was allowing January 1st, Year 1 to bypass our date validation).
Please see snippet below - is this a case of user error, or bug?
It appears to be specific to a dob value of
time.Date(1, time.Month(1), 1, 0, 0, 0, 0, time.UTC)
If we add at least one nanosecond to DOB value of January 1st, Year 1 - Ozzo Validation correctly rejects invalid date
The text was updated successfully, but these errors were encountered: