Skip to content

Commit

Permalink
🐛 sanitize application input
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Jun 10, 2024
1 parent 681a745 commit 2a68d8d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class ApplicationData {
"([\\s\\S]*?<!--CONTRIBUTION::-->)([\\s\\S]*?)(<!--::CONTRIBUTION-->[\\s\\S]*?)", Pattern.CASE_INSENSITIVE);
static final Pattern NOTES = Pattern.compile("([\\s\\S]*?<!--NOTES::-->)([\\s\\S]*?)(<!--::NOTES-->[\\s\\S]*?)",
Pattern.CASE_INSENSITIVE);
static final Pattern STRIP_COMMENTS = Pattern.compile("<!--:?:?(CONTRIBUTION|NOTES):?:?-->", Pattern.CASE_INSENSITIVE);

transient String title;
transient MembershipApplication application;
Expand Down Expand Up @@ -103,8 +104,8 @@ public static String issueContent(MemberSession session, ApplicationPost applica
""".formatted(
session.login(),
session.url(),
applicationPost.contributions(),
applicationPost.additionalNotes());
STRIP_COMMENTS.matcher(applicationPost.contributions()).replaceAll(" "),
STRIP_COMMENTS.matcher(applicationPost.additionalNotes()).replaceAll(" "));
}

public static String createTitle(MemberSession session) {
Expand Down

0 comments on commit 2a68d8d

Please sign in to comment.