mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
* Fix regex to account for fractional seconds. With thanks to @aagxxi who provided the initial fix.
This commit is contained in:
parent
9f9391e55c
commit
7c058361c7
2 changed files with 3 additions and 2 deletions
|
|
@ -124,7 +124,7 @@ Item makeDatabaseItem(JSONValue driveItem) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set this item object type
|
||||
bool typeSet = false;
|
||||
if (isItemFile(driveItem)) {
|
||||
|
|
|
|||
|
|
@ -528,7 +528,8 @@ bool isValidUTF16(string path) {
|
|||
// Validate that the provided string is a valid date time stamp in UTC format
|
||||
bool isValidUTCDateTime(string dateTimeString) {
|
||||
// Regular expression for validating the string against UTC datetime format
|
||||
auto pattern = regex(r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$");
|
||||
// Allows for an optional fractional second part (e.g., .123 or .123456789)
|
||||
auto pattern = regex(r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$");
|
||||
|
||||
// Validate for UTF-8 first
|
||||
if (!isValidUTF8(dateTimeString)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue