Compare commits

...

13 Commits

Author SHA1 Message Date
Misty Release Bot
35efc444ce chore: incrementing version number - v3.1.6 2023-06-15 19:45:03 +00:00
Barış Soner Uşaklı
8620a2cd0a fix: #11717 prevent crash in messaging 2023-06-15 15:33:36 -04:00
Barış Soner Uşaklı
a757716ddd fix: closes #11708, fix quick reply check 2023-06-13 16:08:59 -04:00
Misty Release Bot
b0d1686185 chore: update changelog for v3.1.5 2023-06-13 18:50:11 +00:00
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
12 changed files with 64 additions and 37 deletions

View File

@@ -1,3 +1,39 @@
#### v3.1.5 (2023-06-13)
##### Chores
* fix persona (74174414)
* up themes (97ff1f11)
* incrementing version number - v3.1.4 (2452783c)
* update changelog for v3.1.4 (633dc2de)
* incrementing version number - v3.1.3 (3b4e9d3f)
* incrementing version number - v3.1.2 (40fa3489)
* incrementing version number - v3.1.1 (40250733)
* incrementing version number - v3.1.0 (0cb386bd)
* incrementing version number - v3.0.1 (26f6ea49)
* incrementing version number - v3.0.0 (224e08cd)
##### New Features
* add back support for req.body._csrf (67f44a32)
##### Bug Fixes
* improper neutralization of user input in image wrapping code (1d1639d4)
* don't update edit data if edited timestamp is not available (c5cd76e7)
* filter null nav items (b73f307a)
* rimraf usage in user image delete (3256fb30)
* closes #11620, fix copy code when line numbers are enabled (82e26829)
* logins dashboard user images (8cb6ebb9)
##### Refactors
* change welcome headers to be smaller (0c4870ec)
##### Tests
* remove socket.io test (24ebb153)
#### v3.1.4 (2023-05-18)
##### Chores

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.6",
"homepage": "https://www.nodebb.org",
"repository": {
"type": "git",

View File

@@ -371,7 +371,7 @@ define('forum/topic', [
}
function setupQuickReply() {
if (config.enableQuickReply || config.theme.enableQuickReply) {
if (config.enableQuickReply || (config.theme && config.theme.enableQuickReply)) {
quickreply.init();
}
}

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

@@ -111,7 +111,7 @@ Messaging.getRecentChats = async (callerUid, uid, start, stop) => {
teasers: Promise.all(roomIds.map(async roomId => Messaging.getTeaser(uid, roomId))),
});
results.roomData.forEach((room, index) => {
await Promise.all(results.roomData.map(async (room, index) => {
if (room) {
room.users = results.users[index];
room.groupChat = room.hasOwnProperty('groupChat') ? room.groupChat : room.users.length > 2;
@@ -125,12 +125,9 @@ Messaging.getRecentChats = async (callerUid, uid, start, stop) => {
});
room.users = room.users.filter(user => user && parseInt(user.uid, 10));
room.lastUser = room.users[0];
room.usernames = Messaging.generateUsernames(room.users, uid);
room.chatWithMessage = await Messaging.generateChatWithMessage(room.users, uid);
}
});
await Promise.all(results.roomData.map(async (room) => {
room.chatWithMessage = await Messaging.generateChatWithMessage(room.users, uid);
}));
results.roomData = results.roomData.filter(Boolean);

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) => {