mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 08:54:17 -04:00
Remove sanitize
Remove the input trim No initialize a variable
This commit is contained in:
@@ -108,7 +108,6 @@ module.exports = {
|
|||||||
data: {
|
data: {
|
||||||
message: 'OK',
|
message: 'OK',
|
||||||
vouchers: cache.vouchers.map((voucher) => {
|
vouchers: cache.vouchers.map((voucher) => {
|
||||||
const parsedNotes = notes(voucher.name);
|
|
||||||
return {
|
return {
|
||||||
id: voucher.id,
|
id: voucher.id,
|
||||||
code: `${voucher.code.slice(0, 5)}-${voucher.code.slice(5)}`,
|
code: `${voucher.code.slice(0, 5)}-${voucher.code.slice(5)}`,
|
||||||
@@ -117,7 +116,7 @@ module.exports = {
|
|||||||
data_limit: voucher.dataUsageLimitMBytes ? voucher.dataUsageLimitMBytes : null,
|
data_limit: voucher.dataUsageLimitMBytes ? voucher.dataUsageLimitMBytes : null,
|
||||||
download_limit: voucher.rxRateLimitKbps ? voucher.rxRateLimitKbps : null,
|
download_limit: voucher.rxRateLimitKbps ? voucher.rxRateLimitKbps : null,
|
||||||
upload_limit: voucher.txRateLimitKbps ? voucher.txRateLimitKbps : null,
|
upload_limit: voucher.txRateLimitKbps ? voucher.txRateLimitKbps : null,
|
||||||
note: parsedNotes.note
|
note: notes(voucher.name).note
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
updated: cache.updated
|
updated: cache.updated
|
||||||
@@ -193,11 +192,8 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
return;
|
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
|
// Build the note string expected by utils/notes.js
|
||||||
|
|||||||
Reference in New Issue
Block a user