mirror of
https://github.com/W1NDes/M-AzurLaneAutoScript.git
synced 2026-05-14 06:07:59 +08:00
Fix: Validate datetime instead of using regex (#3252)
This commit is contained in:
parent
e3e72f02cf
commit
1d1d20fef9
@ -455,7 +455,11 @@ def get_localstorage(key):
|
||||
|
||||
def re_fullmatch(pattern, string):
|
||||
if pattern == "datetime":
|
||||
pattern = RE_DATETIME
|
||||
try:
|
||||
datetime.datetime.fromisoformat(string)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
# elif:
|
||||
return re.fullmatch(pattern=pattern, string=string)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user