fix tripcode bugs

merge-requests/208/head
fatchan 5 years ago
parent 41d804f9e3
commit ecaa0277e8
  1. 14
      models/api/make-post.js
  2. 3
      static/css/style.css

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

@ -74,12 +74,13 @@ input, textarea {
.post-file {
display: inline-flex;
flex-direction: column;
margin: 5px;
margin: 0px 4px;
}
.post-file-info {
text-align: center;
margin: 2px;
margin-top: 0px;
max-width: 128px;
word-break: break-all;
}

Loading…
Cancel
Save