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

@@ -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