fix(backend): reject malformed timestamp (#12554)

This commit is contained in:
Acid Chicken (硫酸鶏)
2023-12-03 14:38:42 +09:00
committed by GitHub
parent 34223f3da4
commit af15f8d09d
8 changed files with 49 additions and 6 deletions

View File

@@ -41,3 +41,7 @@ export function parseAidx(id: string): { date: Date; } {
const time = parseInt(id.slice(0, TIME_LENGTH), 36) + TIME2000;
return { date: new Date(time) };
}
export function isSafeAidxT(t: number): boolean {
return t > TIME2000;
}