From 10680b0eebb883c982e8e5ab728fabd00c9d9ba7 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期四, 20 八月 2026 17:41:37 +0800
Subject: [PATCH] 更新
---
src/protocol.js | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/src/protocol.js b/src/protocol.js
index 5b260b2..2440e2c 100644
--- a/src/protocol.js
+++ b/src/protocol.js
@@ -150,7 +150,20 @@
buildTimeString(parts) {
const [year, month, day, hour, minute, second] = parts;
- if (!year) return null;
+ if (
+ !year ||
+ year < 2000 ||
+ year > 2099 ||
+ month < 1 ||
+ month > 12 ||
+ day < 1 ||
+ day > 31 ||
+ hour > 23 ||
+ minute > 59 ||
+ second > 59
+ ) {
+ return null;
+ }
const y = year.toString().padStart(4, "0");
const m = String(month || 0).padStart(2, "0");
const d = String(day || 0).padStart(2, "0");
--
Gitblit v1.8.0