mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 01:21:13 +01:00
wrap quotes to prevent stripping leading 0
This commit is contained in:
committed by
Julian Lam
parent
9e685e657a
commit
4b94c033c4
@@ -70,7 +70,12 @@ module.exports = function (User) {
|
||||
|
||||
let line = '';
|
||||
usersData.forEach((user, index) => {
|
||||
line += `${fields.map(field => user[field]).join(',')}`;
|
||||
line += `${fields.map(field => {
|
||||
if ( /^\d+$/.test(user[field])) {
|
||||
return `'${user[field]}'`;
|
||||
}
|
||||
return user[field]
|
||||
}).join(',')}`;
|
||||
if (showIps) {
|
||||
userIPs = ips[index] ? ips[index].join(',') : '';
|
||||
line += `,"${userIPs}"\n`;
|
||||
|
||||
Reference in New Issue
Block a user