mirror of
https://github.com/araddon/dateparse.git
synced 2025-09-19 05:05:15 +08:00
Dont allow unix-seconds to be negative
This commit is contained in:
@@ -574,7 +574,12 @@ iterRunes:
|
||||
}
|
||||
if t.IsZero() {
|
||||
if secs, err := strconv.ParseInt(datestr, 10, 64); err == nil {
|
||||
t = time.Unix(secs, 0)
|
||||
if secs < 0 {
|
||||
// Now, for unix-seconds we aren't going to guess a lot
|
||||
// nothing before unix-epoch
|
||||
} else {
|
||||
t = time.Unix(secs, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
if !t.IsZero() {
|
||||
|
Reference in New Issue
Block a user