From 122d2aebdef3099699af87b503924ab90518bd89 Mon Sep 17 00:00:00 2001 From: nickelblack619 Date: Tue, 30 Dec 2025 01:23:03 +0100 Subject: [PATCH] Remove sanitize Remove the input trim No initialize a variable --- controllers/api.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/controllers/api.js b/controllers/api.js index 564f1f9..334c167 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -108,7 +108,6 @@ module.exports = { data: { message: 'OK', vouchers: cache.vouchers.map((voucher) => { - const parsedNotes = notes(voucher.name); return { id: voucher.id, code: `${voucher.code.slice(0, 5)}-${voucher.code.slice(5)}`, @@ -117,7 +116,7 @@ module.exports = { data_limit: voucher.dataUsageLimitMBytes ? voucher.dataUsageLimitMBytes : null, download_limit: voucher.rxRateLimitKbps ? voucher.rxRateLimitKbps : null, upload_limit: voucher.txRateLimitKbps ? voucher.txRateLimitKbps : null, - note: parsedNotes.note + note: notes(voucher.name).note }; }), updated: cache.updated @@ -193,11 +192,8 @@ module.exports = { }); return; } + noteInput = req.body.note; - // Remove any existing internal separators to prevent format breakage - noteInput = req.body.note.replace(/\|\|;;\|\|/g, ' '); - // Optionally, trim and limit length to a reasonable value (e.g. 255 chars) - noteInput = noteInput.trim().slice(0, 255); } // Build the note string expected by utils/notes.js