|
|
@ -136,11 +136,15 @@ module.exports = async (req, res, numFiles) => { |
|
|
|
|
|
|
|
|
|
|
|
//tripcodes
|
|
|
|
//tripcodes
|
|
|
|
let name = req.body.name; |
|
|
|
let name = req.body.name; |
|
|
|
const password = name.substring(name.indexOf('##') + 2); |
|
|
|
//if it contains 2 hashtags
|
|
|
|
if (password && password.length > 0) { |
|
|
|
const tripCodeIndex = name.indexOf('##'); |
|
|
|
name = name.substring(0, name.indexOf('##')); |
|
|
|
if (tripCodeIndex !== -1 ) { |
|
|
|
const tripcode = await getTripCode(password); |
|
|
|
const passwordOnly = name.substring(tripCodeIndex+2); |
|
|
|
name = `${name}##${tripcode}`; |
|
|
|
if (passwordOnly.length > 0) { |
|
|
|
|
|
|
|
const nameOnly = name.substring(0, tripCodeIndex); |
|
|
|
|
|
|
|
const tripcode = await getTripCode(passwordOnly); |
|
|
|
|
|
|
|
name = `${nameOnly}##${tripcode}`; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//simple markdown and sanitize
|
|
|
|
//simple markdown and sanitize
|
|
|
|