Skip to content

Commit e67fa7e

Browse files
committed
adjust date parsing regex
1 parent df8d600 commit e67fa7e

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

docker.versions.plg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" min="7.2.0">
1414
<CHANGES>
15+
###2026.03.06
16+
- Adjusted date regex to be more strict to avoid false positives on date parsing for text changelogs
17+
1518
###2025.10.31
1619
- Fixed styling to support 7.2.0 ui changes
1720

src/docker.versions/usr/local/emhttp/plugins/docker.versions/server/services/Releases.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ function parseChangelogFile(): void
313313
"(\d{2}[-\/]\d{2}[-\/]\d{4}(?!\d))", // Matches MM-DD-YYYY or MM/DD/YYYY.
314314
"(\d{4}[-\/]\d{1,2}[-\/]\d{1,2}(?!\d))", // Matches YYYY-M-D or YYYY/M/D.
315315
"(\d{1,2}[-\/]\d{1,2}[-\/]\d{4}(?!\d))", // Matches D-M-YYYY or D/M/YYYY.
316-
"([A-Za-z]{3} [A-Za-z]* \d{1,2}(st|nd|rd|th)?,? \d{4}(?!\d))", // Matches Mon MONTH 15th 2024 or similar.
317-
"(\d{1,2}(st|nd|rd|th)?,? [A-Za-z]* \d{4}(?!\d))" // Matches 15th MONTH 2024 or similar. (tdarr)
316+
"([A-Za-z]{3} [A-Za-z]{3,9} (0?[1-9]|[12]\\d|3[01])(st|nd|rd|th)?,? \d{4}(?!\d))", // Matches Mon MONTH 15th 2024 or similar.
317+
"((0?[1-9]|[12]\\d|3[01])(st|nd|rd|th)?,? [A-Za-z]{3,9} \d{4}(?!\d))" // Matches 15th MONTH 2024 or similar. (tdarr)
318318
];
319319
$dateRegex = "/" . implode("|", $dateRegexParts) . "/";
320320

0 commit comments

Comments
 (0)