From 2eb36b03a625dbe211af988395b53f063a082e0a Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Fri, 12 Jan 2024 16:06:05 +0000 Subject: [PATCH 01/10] chore: incrementing version number - v3.6.3 --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index ed3ca0e4af..bb30df3d1c 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "3.6.2", + "version": "3.6.3", "homepage": "https://www.nodebb.org", "repository": { "type": "git", From 92ffc57cceb7293193ce3992a17323903c97662e Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Fri, 12 Jan 2024 16:06:06 +0000 Subject: [PATCH 02/10] chore: update changelog for v3.6.3 --- CHANGELOG.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94d2255224..0a21d27aa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,48 @@ +#### v3.6.3 (2024-01-12) + +##### Chores + +* incrementing version number - v3.6.2 (0f577a57) +* update changelog for v3.6.2 (82a936c3) +* incrementing version number - v3.6.1 (f1a69468) +* incrementing version number - v3.6.0 (4cdf85f8) +* incrementing version number - v3.5.3 (ed0e8783) +* incrementing version number - v3.5.2 (52fbb2da) +* incrementing version number - v3.5.1 (4c543488) +* incrementing version number - v3.5.0 (d06fb4f0) +* incrementing version number - v3.4.3 (5c984250) +* incrementing version number - v3.4.2 (3f0dac38) +* incrementing version number - v3.4.1 (01e69574) +* incrementing version number - v3.4.0 (fd9247c5) +* incrementing version number - v3.3.9 (5805e770) +* incrementing version number - v3.3.8 (a5603565) +* incrementing version number - v3.3.7 (b26f1744) +* incrementing version number - v3.3.6 (7fb38792) +* incrementing version number - v3.3.4 (a67f84ea) +* incrementing version number - v3.3.3 (f94d239b) +* incrementing version number - v3.3.2 (ec9dac97) +* incrementing version number - v3.3.1 (151cc68f) +* incrementing version number - v3.3.0 (fc1ad70f) +* incrementing version number - v3.2.3 (b06d3e63) +* incrementing version number - v3.2.2 (758ecfcd) +* incrementing version number - v3.2.1 (20145074) +* incrementing version number - v3.2.0 (9ecac38e) +* incrementing version number - v3.1.7 (0b4e81ab) +* incrementing version number - v3.1.6 (b3a3b130) +* incrementing version number - v3.1.5 (ec19343a) +* incrementing version number - v3.1.4 (2452783c) +* 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) + +##### Bug Fixes + +* #12275, pin sharp to 0.32.6 (f3927ce7) +* topic event translations closes #12273 (5f91cc83) + #### v3.6.2 (2024-01-10) ##### Chores From 76f3efff8f1edebb98ad57f625dc9c3b7058a07b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 16 Jan 2024 10:13:50 -0500 Subject: [PATCH 03/10] fix: validate plugin id in toggleActive --- public/language/en-GB/error.json | 1 + src/plugins/install.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/language/en-GB/error.json b/public/language/en-GB/error.json index 75a8328aa1..7f2511747b 100644 --- a/public/language/en-GB/error.json +++ b/public/language/en-GB/error.json @@ -255,6 +255,7 @@ "no-connection": "There seems to be a problem with your internet connection", "socket-reconnect-failed": "Unable to reach the server at this time. Click here to try again, or try again later", + "invalid-plugin-id": "Invalid plugin ID", "plugin-not-whitelisted": "Unable to install plugin – only plugins whitelisted by the NodeBB Package Manager can be installed via the ACP", "plugins-set-in-configuration": "You are not allowed to change plugin state as they are defined at runtime (config.json, environmental variables or terminal arguments), please modify the configuration instead.", "theme-not-set-in-configuration": "When defining active plugins in configuration, changing themes requires adding the new theme to the list of active plugins before updating it in the ACP", diff --git a/src/plugins/install.js b/src/plugins/install.js index 91a39da76e..21d993226d 100644 --- a/src/plugins/install.js +++ b/src/plugins/install.js @@ -12,7 +12,7 @@ const request = require('../request'); const db = require('../database'); const meta = require('../meta'); const pubsub = require('../pubsub'); -const { paths } = require('../constants'); +const { paths, pluginNamePattern } = require('../constants'); const pkgInstall = require('../cli/package-install'); const packageManager = pkgInstall.getPackageManager(); @@ -60,6 +60,9 @@ module.exports = function (Plugins) { winston.error('Cannot activate plugins while plugin state is set in the configuration (config.json, environmental variables or terminal arguments), please modify the configuration instead'); throw new Error('[[error:plugins-set-in-configuration]]'); } + if (!pluginNamePattern.test(id)) { + throw new Error('[[error:invalid-plugin-id]]'); + } const isActive = await Plugins.isActive(id); if (isActive) { await db.sortedSetRemove('plugins:active', id); From e8befbcc6f0bea51aa417083c9ff54ee49306f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 17 Jan 2024 15:18:26 -0500 Subject: [PATCH 04/10] test: add plugin id tests --- test/plugins.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/plugins.js b/test/plugins.js index 1260f8fd71..582823b33a 100644 --- a/test/plugins.js +++ b/test/plugins.js @@ -262,6 +262,18 @@ describe('Plugins', () => { }); }); + it('should error if plugin id is invalid', async () => { + await assert.rejects( + plugins.toggleActive('\t\nnodebb-plugin'), + { message: '[[error:invalid-plugin-id]]' } + ); + + await assert.rejects( + plugins.toggleActive('notaplugin'), + { message: '[[error:invalid-plugin-id]]' } + ); + }); + it('should upgrade plugin', function (done) { this.timeout(0); plugins.upgrade(pluginName, 'latest', (err, isActive) => { From 4427ca4cab0b38aa7b53119093e70b4a9119f481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 18 Jan 2024 17:58:41 -0500 Subject: [PATCH 05/10] add itemprop="comment" --- src/views/partials/data/topic.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/partials/data/topic.tpl b/src/views/partials/data/topic.tpl index 4c3b70640c..846d17eb40 100644 --- a/src/views/partials/data/topic.tpl +++ b/src/views/partials/data/topic.tpl @@ -1 +1 @@ -data-index="{posts.index}" data-pid="{posts.pid}" data-uid="{posts.uid}" data-timestamp="{posts.timestamp}" data-username="{posts.user.username}" data-userslug="{posts.user.userslug}"{{{ if posts.allowDupe }}} data-allow-dupe="1"{{{ end }}}{{{ if posts.navigatorIgnore }}} data-navigator-ignore="1"{{{ end }}} itemscope itemtype="http://schema.org/Comment" \ No newline at end of file +data-index="{posts.index}" data-pid="{posts.pid}" data-uid="{posts.uid}" data-timestamp="{posts.timestamp}" data-username="{posts.user.username}" data-userslug="{posts.user.userslug}"{{{ if posts.allowDupe }}} data-allow-dupe="1"{{{ end }}}{{{ if posts.navigatorIgnore }}} data-navigator-ignore="1"{{{ end }}} itemprop="comment" itemtype="http://schema.org/Comment" itemscope \ No newline at end of file From 06269cdfe4d9e2a754cec77f35331f5c9185d5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 22 Jan 2024 12:55:44 -0500 Subject: [PATCH 06/10] fix: copy single line code blocks, closes #12297 --- public/src/client/topic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index dc311d1c38..b4dd497dc3 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -224,7 +224,7 @@ define('forum/topic', [ btn.find('i').removeClass('fa-copy').addClass('fa-check'); setTimeout(() => btn.find('i').removeClass('fa-check').addClass('fa-copy'), 2000); const codeEl = btn.parent().find('code'); - if (codeEl.attr('data-lines')) { + if (codeEl.attr('data-lines') && codeEl.find('.hljs-ln-code[data-line-number]').length) { return codeEl.find('.hljs-ln-code[data-line-number]') .map((i, e) => e.textContent).get().join('\n'); } From d5f445f15ed84dccb32614ba2468dc84d339a861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 23 Jan 2024 10:24:44 -0500 Subject: [PATCH 07/10] fix: remove leftover code from 2.x, closes #12301 --- public/src/admin/settings/navigation.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/src/admin/settings/navigation.js b/public/src/admin/settings/navigation.js index c858f8ccc4..375398cbee 100644 --- a/public/src/admin/settings/navigation.js +++ b/public/src/admin/settings/navigation.js @@ -100,7 +100,6 @@ define('admin/settings/navigation', [ translator.translate(li, function (li) { li = $(translator.unescape(li)); $('#enabled').append(li); - componentHandler.upgradeDom(); resolve(); }); }); From 20d88e68616ada1ffc8c0b950538c41d0b6adb3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 24 Jan 2024 11:27:07 -0500 Subject: [PATCH 08/10] use template name instead of url sometimes topic.tpl can be rendered on a different url --- public/src/modules/navigator.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js index 9051524370..515b4947e0 100644 --- a/public/src/modules/navigator.js +++ b/public/src/modules/navigator.js @@ -458,11 +458,9 @@ define('navigator', [ }; function toggle(flag) { - const path = ajaxify.removeRelativePath(window.location.pathname.slice(1)); - if (flag && (!path.startsWith('topic') && !path.startsWith('category'))) { + if (flag && (!ajaxify.data.template.topic && !ajaxify.data.template.category)) { return; } - paginationBlockEl.toggleClass('ready', flag); paginationBlockEl.toggleClass('noreplies', count <= 1); } From cb21f28b56beb7faefcccda29e8c9828d94bece1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 24 Jan 2024 12:00:27 -0500 Subject: [PATCH 09/10] feat: add success hook to quick reply --- public/src/modules/quickreply.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/src/modules/quickreply.js b/public/src/modules/quickreply.js index d4f59bea51..99be979319 100644 --- a/public/src/modules/quickreply.js +++ b/public/src/modules/quickreply.js @@ -2,10 +2,10 @@ define('quickreply', [ 'components', 'composer', 'composer/autocomplete', 'api', - 'alerts', 'uploadHelpers', 'mousetrap', 'storage', + 'alerts', 'uploadHelpers', 'mousetrap', 'storage', 'hooks', ], function ( components, composer, autocomplete, api, - alerts, uploadHelpers, mousetrap, storage + alerts, uploadHelpers, mousetrap, storage, hooks ) { const QuickReply = {}; @@ -91,6 +91,7 @@ define('quickreply', [ components.get('topic/quickreply/text').val(''); storage.removeItem(qrDraftId); autocomplete._active.core_qr.hide(); + hooks.fire('action:quickreply.success', { data }); }); }); From cf40d68176bac06c60978c2dad70b96be2a57bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 24 Jan 2024 12:11:17 -0500 Subject: [PATCH 10/10] fix: if there is no bookmarkThreshold dont init unread indicator --- public/src/modules/navigator.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js index 515b4947e0..3cf81cbe9c 100644 --- a/public/src/modules/navigator.js +++ b/public/src/modules/navigator.js @@ -353,7 +353,8 @@ define('navigator', [ } async function updateUnreadIndicator(index) { - if (!paginationBlockUnreadEl.length || ajaxify.data.postcount <= ajaxify.data.bookmarkThreshold) { + const { bookmarkThreshold } = ajaxify.data; + if (!paginationBlockUnreadEl.length || ajaxify.data.postcount <= bookmarkThreshold || !bookmarkThreshold) { return; } const currentBookmark = ajaxify.data.bookmark || storage.getItem('topic:' + ajaxify.data.tid + ':bookmark');