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 //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

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

Loading…
Cancel
Save