Skip to content

Commit

Permalink
update trailing character cleanup regex in FlexibleDateTimeParser
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdahlke committed Apr 26, 2024
1 parent ed1ac9c commit 348d21f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/emissary/util/FlexibleDateTimeParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class FlexibleDateTimeParser {
private static final Pattern REPLACE = Pattern.compile("\t+|[ ]+", Pattern.DOTALL);

/* Remove other junk */
private static final Pattern REMOVE = Pattern.compile("<.+?>|=0D$", Pattern.DOTALL);
private static final Pattern REMOVE = Pattern.compile("<.+?>$|=0D$", Pattern.DOTALL);

/* timezone - config var: TIMEZONE */
private static ZoneId timezone = ZoneId.of(DEFAULT_TIMEZONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ void parse_yyyy_DDD() {
@Test
void testCleanDateString() {
test("2016-01-04 18:20<br>", EXPECTED_NO_SECS, "HTML");
test("2016-01-04 18:20<br>br>", EXPECTED_NO_SECS, "HTML");
test("2016-01-04\t\t18:20", EXPECTED_NO_SECS, "TABS");
test("2016-01-04 18:20", EXPECTED_NO_SECS, "SPACES");
test("2016-01-04 18:20=0D", EXPECTED_NO_SECS, "qp'ified ending");
Expand Down

0 comments on commit 348d21f

Please sign in to comment.