fix cannot respond to usenet post with ' in subject

This commit is contained in:
zefie
2025-08-14 18:12:32 -04:00
parent be5e2f2734
commit e2e99b3f0e
2 changed files with 10 additions and 1 deletions

View File

@@ -509,7 +509,7 @@ cellspacing=0 cellpadding=0>
<tr>
<td abswidth=6>
<td abswidth=93 absheight=26>
<table href="wtv-mail:/sendmail?discuss=true&message_subject=${encodeURIComponent("Re: " + response.article.headers.SUBJECT)}&group=${response.article.headers.NEWSGROUPS}&discuss-prefix=${service_name}&article=${request_headers.query.article}"
<table href="wtv-mail:/sendmail?discuss=true&message_subject=${escape("Re: " + response.article.headers.SUBJECT)}&group=${response.article.headers.NEWSGROUPS}&discuss-prefix=${service_name}&article=${request_headers.query.article}"
cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>

View File

@@ -3,6 +3,7 @@
*/
const CryptoJS = require('crypto-js');
const WTVShenanigans = require('./WTVShenanigans.js');
const e = require('express');
class WTVShared {
@@ -53,6 +54,14 @@ class WTVShared {
}
}
escape(string) {
return encodeURIComponent(string).replace(/'/g, "%27").replace(/"/g, "%22");
}
unescape(string) {
return decodeURIComponent(string.replace(/\+/g, " "));
}
/**
* convert a CryptoJS.lib.WordArray to a Javascript Buffer
* @param {CryptoJS.lib.WordArray} wordArray