Skip to content

Commit 443f948

Browse files
committed
The + seems optional for relative times
See the CLICS spec: https://github.com/icpc/ccs-specs/blame/master/Contest_API.md#L235.
1 parent f0ef1e7 commit 443f948

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webapp/src/Validator/Constraints/TimeStringValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public function validate(mixed $value, Constraint $constraint): void
2525

2626
if ($constraint->allowRelative) {
2727
$regex = $constraint->relativeIsPositive ?
28-
"/^(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d{2,6})? [A-Za-z][A-Za-z0-9_\/+-]{1,35}|\+" . $relativeRegex . ")$/" :
29-
"/^(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d{1,6})? [A-Za-z][A-Za-z0-9_\/+-]{1,35}|-" . $relativeRegex . ")$/";
28+
"/^(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d{2,6})? [A-Za-z][A-Za-z0-9_\/+-]{1,35}|\+?" . $relativeRegex . ")$/" :
29+
"/^(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d{1,6})? [A-Za-z][A-Za-z0-9_\/+-]{1,35}|-" . $relativeRegex . ")$/";
3030
$message = $constraint->absoluteRelativeMessage;
3131
} else {
3232
$regex = "/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d{1,6})? [A-Za-z][A-Za-z0-9_\/+-]{1,35}$/";

0 commit comments

Comments
 (0)