Compare commits

...

9 Commits

Author SHA1 Message Date
Misty Release Bot
3eaf04827e chore: incrementing version number - v3.1.5 2023-06-13 18:50:11 +00:00
Julian Lam
1d1639d46f fix: improper neutralization of user input in image wrapping code 2023-06-13 11:55:13 -04:00
Julian Lam
c5cd76e798 fix: don't update edit data if edited timestamp is not available 2023-06-09 12:44:06 -04:00
Barış Soner Uşaklı
b73f307abe fix: filter null nav items 2023-06-03 11:14:39 -04:00
Barış Soner Uşaklı
6aae88d5dd use bs5 classes for toggle 2023-05-29 19:32:20 -04:00
Barış Soner Uşaklı
0c4870ec12 refactor: change welcome headers to be smaller 2023-05-27 18:12:25 -04:00
Barış Soner Uşaklı
67f44a3212 feat: add back support for req.body._csrf
used in login.tpl etc for noscript login
2023-05-27 16:46:04 -04:00
Barış Soner Uşaklı
3256fb30e7 fix: rimraf usage in user image delete
https://github.com/isaacs/rimraf/issues/275#issuecomment-1562402287
2023-05-25 09:12:02 -04:00
Barış Soner Uşaklı
24ebb1536b test: remove socket.io test 2023-05-23 16:48:00 -04:00
9 changed files with 25 additions and 31 deletions

View File

@@ -1,9 +1,9 @@
# Welcome to your brand new NodeBB forum!
### Welcome to your brand new NodeBB forum!
This is what a topic and post looks like. As an administrator, you can edit the post\'s title and content.
To customise your forum, go to the [Administrator Control Panel](../../admin). You can modify all aspects of your forum there, including installation of third-party plugins.
## Additional Resources
#### Additional Resources
* [NodeBB Documentation](https://docs.nodebb.org)
* [Community Support Forum](https://community.nodebb.org)

View File

@@ -2,7 +2,7 @@
"name": "nodebb",
"license": "GPL-3.0",
"description": "NodeBB Forum",
"version": "3.1.4",
"version": "3.1.5",
"homepage": "https://www.nodebb.org",
"repository": {
"type": "git",

View File

@@ -142,19 +142,21 @@ define('forum/topic/events', [
posts.addBlockquoteEllipses(editedPostEl.parent());
editedPostEl.fadeIn(250);
const editData = {
editor: data.editor,
editedISO: utils.toISOString(data.post.edited),
};
if (data.post.edited) {
const editData = {
editor: data.editor,
editedISO: utils.toISOString(data.post.edited),
};
app.parseAndTranslate('partials/topic/post-editor', editData, function (html) {
editorEl.replaceWith(html);
postContainer.find('[component="post/edit-indicator"]')
.removeClass('hidden')
.translateAttr('title', `[[global:edited-timestamp, ${editData.editedISO}]]`);
postContainer.find('[component="post/editor"] .timeago').timeago();
hooks.fire('action:posts.edited', data);
});
app.parseAndTranslate('partials/topic/post-editor', editData, function (html) {
editorEl.replaceWith(html);
postContainer.find('[component="post/edit-indicator"]')
.removeClass('hidden')
.translateAttr('title', `[[global:edited-timestamp, ${editData.editedISO}]]`);
postContainer.find('[component="post/editor"] .timeago').timeago();
hooks.fire('action:posts.edited', data);
});
}
});
} else {
hooks.fire('action:posts.edited', data);

View File

@@ -26,8 +26,9 @@ define('forum/topic/images', [], function () {
const srcExt = src.split('.').slice(1).pop();
const altFilename = alt.split('/').pop();
const altExt = altFilename.split('.').slice(1).pop();
imageEl.wrap('<a href="' + src + '" ' +
(!srcExt && altExt ? ' download="' + altFilename + '" ' : '') +
(!srcExt && altExt ? ' download="' + utils.escapeHTML(altFilename) + '" ' : '') +
' target="_blank" rel="noopener">');
}
};

View File

@@ -440,7 +440,7 @@ define('forum/topic/posts', [
blockquotes.each(function () {
const $this = $(this);
if ($this.find(':hidden:not(br)').length && !$this.find('.toggle').length) {
$this.append('<i class="fa fa-angle-down pointer toggle"></i>');
$this.append('<i class="d-inline-block fa fa-angle-down pointer toggle py-1 px-3 border text-bg-light"></i>');
}
});
};

View File

@@ -12,7 +12,9 @@ const {
return req.headers['x-csrf-token'];
} else if (req.body && req.body.csrf_token) {
return req.body.csrf_token;
} else if (req.query) {
} else if (req.body && req.body._csrf) {
return req.body._csrf;
} else if (req.query && req.query._csrf) {
return req.query._csrf;
}
},

View File

@@ -65,7 +65,7 @@ admin.get = async function () {
}
const ids = await db.getSortedSetRange('navigation:enabled', 0, -1);
const data = await db.getObjects(ids.map(id => `navigation:enabled:${id}`));
cache = data.map((item) => {
cache = data.filter(Boolean).map((item) => {
if (item.hasOwnProperty('groups')) {
try {
item.groups = JSON.parse(item.groups);

View File

@@ -208,9 +208,6 @@ module.exports = function (User) {
async function deleteImages(uid) {
const folder = path.join(nconf.get('upload_path'), 'profile');
await Promise.all([
rimraf(path.join(folder, `${uid}-profilecover*`), { glob: true }),
rimraf(path.join(folder, `${uid}-profileavatar*`), { glob: true }),
]);
await rimraf(`${uid}-profile{avatar,cover}*`, { glob: { cwd: folder } });
}
};

View File

@@ -107,14 +107,6 @@ describe('socket.io', () => {
});
});
it('should return error for invalid eventName type', (done) => {
const eventName = ['topics.loadMoreTags'];
io.emit(eventName, (err) => {
assert.strictEqual(err.message, `[[error:invalid-event, object]]`);
done();
});
});
it('should get installed themes', (done) => {
const themes = ['nodebb-theme-persona'];
io.emit('admin.themes.getInstalled', (err, data) => {