Skip to content

Commit

Permalink
fix cf emails in subjects
Browse files Browse the repository at this point in the history
  • Loading branch information
miku-nyan committed May 21, 2016
1 parent 10fe333 commit 6912ecb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/nya/miku/wishmaster/api/util/WakabaReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ protected final void finalizePost() {
if (currentPost.trip == null) currentPost.trip = "";
if (canCloudflare) {
currentPost.comment = CryptoUtils.fixCloudflareEmails(currentPost.comment);
currentPost.subject = CryptoUtils.fixCloudflareEmails(currentPost.subject);
if (currentPost.email.startsWith("/cdn-cgi/l/email-protection#"))
currentPost.email = CryptoUtils.decodeCloudflareEmail(currentPost.email.substring(28));
}
Expand Down
1 change: 1 addition & 0 deletions src/nya/miku/wishmaster/chans/cirno/MikubaReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ private void handleFilter(int filterIndex) throws IOException {
break;
case FILTER_SUBJECT:
currentPost.subject = StringEscapeUtils.unescapeHtml4(readUntilSequence(FILTERS_CLOSE[filterIndex])).trim();
currentPost.subject = CryptoUtils.fixCloudflareEmails(currentPost.subject);
inDate = true;
break;
case FILTER_ENDDATE:
Expand Down
1 change: 1 addition & 0 deletions src/nya/miku/wishmaster/chans/krautchan/KrautReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ private void handleFilter(int filterIndex) throws IOException {
break;
case FILTER_SUBJECT:
currentPost.subject = StringEscapeUtils.unescapeHtml4(readUntilSequence(FILTERS_CLOSE[filterIndex])).trim();
currentPost.subject = CryptoUtils.fixCloudflareEmails(currentPost.subject);
break;
case FILTER_POSTERNAME:
currentPost.name = StringEscapeUtils.unescapeHtml4(readUntilSequence(FILTERS_CLOSE[filterIndex])).trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected void customFilters(int ch) throws IOException {
if (ch == SUBJECT_FILTER[curSubjectPos]) {
++curSubjectPos;
if (curSubjectPos == SUBJECT_FILTER.length) {
currentPost.subject = StringEscapeUtils.unescapeHtml4(readUntilSequence(SPAN_CLOSE)).trim();
currentPost.subject = CryptoUtils.fixCloudflareEmails(StringEscapeUtils.unescapeHtml4(readUntilSequence(SPAN_CLOSE)).trim());
curSubjectPos = 0;
}
} else {
Expand Down

0 comments on commit 6912ecb

Please sign in to comment.