Merge remote-tracking branch 'origin/develop' into activitypub

This commit is contained in:
Julian Lam
2023-12-13 13:21:32 -05:00
12 changed files with 110 additions and 65 deletions

View File

@@ -1,3 +1,49 @@
#### v3.5.3 (2023-12-13)
##### Chores
* up composer (245e5df3)
* up composer default (c1f82b78)
* incrementing version number - v3.5.2 (52fbb2da)
* update changelog for v3.5.2 (e2e85053)
* 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
* change translator escape (c434262e)
##### Other Changes
* add types for database abstration layer (#10762) (17cd19c7)
#### v3.5.2 (2023-11-29)
##### Chores

View File

@@ -42,7 +42,7 @@
"registrationApprovalType": "normal",
"allowAccountDelete": 1,
"privateUploads": 0,
"allowedFileExtensions": "png,jpg,bmp,txt",
"allowedFileExtensions": "png,jpg,bmp,txt,webp,webm,mp4,gif",
"uploadRateLimitThreshold": 10,
"uploadRateLimitCooldown": 60,
"allowUserHomePage": 1,
@@ -188,4 +188,4 @@
"maxReconnectionAttempts": 5,
"reconnectionDelay": 1500,
"disableCustomUserSkins": 0
}
}

View File

@@ -2,7 +2,7 @@
"name": "nodebb",
"license": "GPL-3.0",
"description": "NodeBB Forum",
"version": "3.5.2",
"version": "3.5.3",
"homepage": "https://www.nodebb.org",
"repository": {
"type": "git",
@@ -29,12 +29,12 @@
},
"dependencies": {
"@adactive/bootstrap-tagsinput": "0.8.2",
"@fontsource/inter": "5.0.15",
"@fontsource/inter": "5.0.16",
"@fontsource/poppins": "5.0.8",
"@fortawesome/fontawesome-free": "6.5.1",
"@isaacs/ttlcache": "1.4.1",
"@popperjs/core": "2.11.8",
"ace-builds": "1.32.0",
"ace-builds": "1.32.1",
"archiver": "6.0.1",
"async": "3.2.5",
"autoprefixer": "10.4.16",
@@ -63,7 +63,7 @@
"csrf-sync": "4.0.1",
"daemon": "1.1.0",
"diff": "5.1.0",
"esbuild": "0.19.8",
"esbuild": "0.19.9",
"express": "4.18.2",
"express-session": "1.17.3",
"express-useragent": "1.0.15",
@@ -93,7 +93,7 @@
"multiparty": "4.2.3",
"nconf": "0.12.1",
"nodebb-plugin-2factor": "7.4.0",
"nodebb-plugin-composer-default": "10.2.27",
"nodebb-plugin-composer-default": "10.2.29",
"nodebb-plugin-dbsearch": "6.2.3",
"nodebb-plugin-emoji": "5.1.13",
"nodebb-plugin-emoji-android": "4.0.0",

View File

@@ -5,7 +5,7 @@
"none-installed": "Վիջեթներ չեն գտնվել: Ակտիվացրեք վիջեթի հիմնական հավելվածը plugins կառավարման վահանակում:",
"clone-from": "Կլոնավորել վիջեթներ-ից",
"containers.available": "Առկա Containers",
"containers.explanation": "Drag and drop on top of any widget",
"containers.explanation": "Քաշեք և թողեք ցանկացած վիջեթի վերևում",
"containers.none": "None",
"container.well": "Well",
"container.jumbotron": "Jumbotron",

View File

@@ -185,7 +185,7 @@
"post-flagged-too-many-times": "Այս գրառումն արդեն նշվել է ուրիշների կողմից",
"user-flagged-too-many-times": "Այս օգտատերն արդեն դրոշակվել է ուրիշների կողմից",
"cant-flag-privileged": "Ձեզ չի թույլատրվում նշել արտոնյալ օգտատերերի պրոֆիլները կամ բովանդակությունը (մոդերատորներ/համաշխարհային մոդերատորներ/ադմիններ)",
"cant-locate-flag-report": "Cannot locate flag report",
"cant-locate-flag-report": "Հնարավոր չէ գտնել նշված հաշվետվությունը",
"self-vote": "Դուք չեք կարող քվեարկել ձեր սեփական գրառման վրա",
"too-many-upvotes-today": "Դուք կարող եք օրական միայն %1 անգամ կողմ քվեարկել",
"too-many-upvotes-today-user": "Դուք կարող եք միայն օրական %1 անգամ կողմ քվեարկել օգտատիրոջը",

View File

@@ -12,51 +12,51 @@
"you-have-unread-notifications": "Okunmamış bildirimleriniz var.",
"all": "Hepsi",
"topics": "Konular",
"tags": "Tags",
"categories": "Categories",
"tags": "Etiketler",
"categories": "Kategoriler",
"replies": "Yanıtlar",
"chat": "Sohbetler",
"group-chat": "Grup Sohbetleri",
"public-chat": "Public Chats",
"public-chat": "Genel Sohbetler",
"follows": "Takip Edilenler",
"upvote": "Artı Oylananlar",
"awards": "Awards",
"awards": "Ödüller",
"new-flags": "Yeni Şikayetler",
"my-flags": "Vekil olarak atandığım şikayetler",
"bans": "Yasaklamalar",
"new-message-from": "<strong>%1</strong> size bir mesaj gönderdi",
"new-messages-from": "%1 new messages from <strong>%2</strong>",
"new-message-in": "New message in <strong>%1</strong>",
"new-messages-in": "%1 new messages in <strong>%2</strong>",
"user-posted-in-public-room": "<strong>%1</strong> wrote in <strong class=\"text-nowrap\"><i class=\"fa %2\"></i>%3</strong>",
"user-posted-in-public-room-dual": "<strong>%1</strong> and <strong>%2</strong> wrote in <strong class=\"text-nowrap\"><i class=\"fa %3\"></i>%4</strong>",
"user-posted-in-public-room-triple": "<strong>%1</strong>, <strong>%2</strong> and <strong>%3</strong> wrote in <strong class=\"text-nowrap\"><i class=\"fa %4\"></i>%5</strong>",
"user-posted-in-public-room-multiple": "<strong>%1</strong>, <strong>%2</strong> and %3 others wrote in <strong class=\"text-nowrap\"><i class=\"fa %4\"></i>%5</strong>",
"new-messages-from": "<strong>%2</strong> kullanıcısından %1 yeni mesaj var",
"new-message-in": "<strong>%1</strong> odasında yeni mesaj var",
"new-messages-in": "<strong>%2</strong> odasında %1 yeni mesaj var",
"user-posted-in-public-room": "<strong>%1</strong> şu odaya yazdı: <strong class=\"text-nowrap\"><i class=\"fa %2\"></i>%3</strong>",
"user-posted-in-public-room-dual": "<strong>%1</strong> ve <strong>%2</strong> şu odaya yazdı: <strong class=\"text-nowrap\"><i class=\"fa %3\"></i>%4</strong>",
"user-posted-in-public-room-triple": "<strong>%1</strong>, <strong>%2</strong> ve <strong>%3</strong> şu odaya yazdılar: <strong class=\"text-nowrap\"><i class=\"fa %4\"></i>%5</strong>",
"user-posted-in-public-room-multiple": "<strong>%1</strong>, <strong>%2</strong> ve %3 diğer kullanıcı şu odaya yazdılar: <strong class=\"text-nowrap\"><i class=\"fa %4\"></i>%5</strong>",
"upvoted-your-post-in": "<strong>%1</strong> şu konudaki iletinizi beğendi: <strong>%2</strong>.",
"upvoted-your-post-in-dual": "<strong>%1</strong> ve <strong>%2</strong> şu konudaki iletinizi beğendi: <strong>%3</strong>",
"upvoted-your-post-in-triple": "<strong>%1</strong>, <strong>%2</strong> and <strong>%3</strong> have upvoted your post in <strong>%4</strong>.",
"upvoted-your-post-in-multiple": "<strong>%1</strong>, <strong>%2</strong> and %3 others have upvoted your post in <strong>%4</strong>.",
"upvoted-your-post-in-triple": "<strong>%1</strong>, <strong>%2</strong> ve <strong>%3</strong> şu konudaki iletinizi beğendi: <strong>%4</strong>.",
"upvoted-your-post-in-multiple": "<strong>%1</strong>, <strong>%2</strong> ve %3 diğer kullanıcı şu konudaki iletinizi beğendi: <strong>%4</strong>.",
"moved-your-post": "<strong>%1</strong>, iletinizi şuraya taşıdı: <strong>%2</strong>",
"moved-your-topic": "<strong>%1</strong> şuraya taşındı: <strong>%2</strong>",
"user-flagged-post-in": "<strong>%1</strong> şu konudaki bir iletiyi şikayet etti: <strong>%2</strong>",
"user-flagged-post-in-dual": "<strong>%1</strong> ve <strong>%2</strong> şu konudaki bir iletiyi şikayet etti: <strong>%3</strong>",
"user-flagged-post-in-triple": "<strong>%1</strong>, <strong>%2</strong> and <strong>%3</strong> flagged a post in <strong>%4</strong>",
"user-flagged-post-in-multiple": "<strong>%1</strong>, <strong>%2</strong> and %3 others flagged a post in <strong>%4</strong>",
"user-flagged-user": "<strong>%1</strong> şu kullanıcının profilini şikayet etti: (%2)",
"user-flagged-user-dual": "<strong>%1</strong> ve <strong>%2</strong> şu kullanıcının profilini şikayet etti: (%3)",
"user-flagged-user-triple": "<strong>%1</strong>, <strong>%2</strong> and <strong>%3</strong> flagged a user profile (%4)",
"user-flagged-user-multiple": "<strong>%1</strong>, <strong>%2</strong> and %3 others flagged a user profile (%4)",
"user-flagged-post-in-triple": "<strong>%1</strong>, <strong>%2</strong> ve <strong>%3</strong> şu konudaki bir iletiyi şikayet etti: <strong>%4</strong>",
"user-flagged-post-in-multiple": "<strong>%1</strong>, <strong>%2</strong> ve %3 diğer kullanıcı şu konudaki bir iletiyi şikayet etti: <strong>%4</strong>",
"user-flagged-user": "<strong>%1</strong> şu kullanıcıyı şikayet etti: (%2)",
"user-flagged-user-dual": "<strong>%1</strong> ve <strong>%2</strong> şu kullanıcıyı şikayet etti: (%3)",
"user-flagged-user-triple": "<strong>%1</strong>, <strong>%2</strong> ve <strong>%3</strong> şu kullanıcıyı şikayet etti: (%4)",
"user-flagged-user-multiple": "<strong>%1</strong>, <strong>%2</strong> ve %3 diğer üye şu kullanıcıyı şikayet etti: (%4)",
"user-posted-to": "<strong>%1</strong> şu konuya bir ileti yazdı: <strong>%2</strong>",
"user-posted-to-dual": "<strong>%1</strong> ve <strong>%2</strong> şu konuya ileti yazdılar: <strong>%3</strong>",
"user-posted-to-triple": "<strong>%1</strong>, <strong>%2</strong> and <strong>%3</strong> have posted replies to: <strong>%4</strong>",
"user-posted-to-multiple": "<strong>%1</strong>, <strong>%2</strong> and %3 others have posted replies to: <strong>%4</strong>",
"user-posted-to-triple": "<strong>%1</strong>, <strong>%2</strong> ve <strong>%3</strong> şu konuya ileti yazdılar: <strong>%4</strong>",
"user-posted-to-multiple": "<strong>%1</strong>, <strong>%2</strong> ve %3 diğer kullanıcı şu konuya ileti yazdılar: <strong>%4</strong>",
"user-posted-topic": "<strong>%1</strong> şu yeni konuyu oluşturdu: <strong>%2</strong>",
"user-edited-post": "<strong>%1</strong> şu konudaki bir iletiyi değiştirdi: <strong>%2</strong>",
"user-posted-topic-with-tag": "<strong>%1</strong> has posted a new topic with tag <strong>%2</strong>",
"user-posted-topic-with-tag-dual": "<strong>%1</strong> has posted a new topic with tags <strong>%2</strong> and <strong>%3</strong>",
"user-posted-topic-with-tag-triple": "<strong>%1</strong> has posted a new topic with tags <strong>%2</strong>, <strong>%3</strong> and <strong>%4</strong>",
"user-posted-topic-with-tag-multiple": "<strong>%1</strong> has posted a new topic with tags <strong>%2</strong>",
"user-posted-topic-in-category": "<strong>%1</strong> has posted a new topic in <strong>%2</strong>",
"user-posted-topic-with-tag": "<strong>%1</strong> şu etiketi kullanarak yeni bir konu oluşturdu: <strong>%2</strong>",
"user-posted-topic-with-tag-dual": "<strong>%1</strong> şu etiketleri kullanarak yeni bir konu oluşturdu: <strong>%2</strong> ve <strong>%3</strong>",
"user-posted-topic-with-tag-triple": "<strong>%1</strong> şu etiketleri kullanarak yeni bir konu oluşturdu: <strong>%2</strong>, <strong>%3</strong> ve <strong>%4</strong>",
"user-posted-topic-with-tag-multiple": "<strong>%1</strong> şu etiketleri kullanarak yeni bir konu oluşturdu: <strong>%2</strong>",
"user-posted-topic-in-category": "<strong>%1</strong> şu kategoride yeni bir başlık oluşturdu: <strong>%2</strong>",
"user-started-following-you": "<strong>%1</strong> sizi takip etmeye başladı.",
"user-started-following-you-dual": "<strong>%1</strong> ve <strong>%2</strong> sizi takip etmeye başladı.",
"user-started-following-you-triple": "<strong>%1</strong>, <strong>%2</strong> and <strong>%3</strong> started following you.",
@@ -82,8 +82,8 @@
"notification-and-email": "Bildirim & E-posta",
"notificationType-upvote": "Biri iletinize artı oy verdiğinde",
"notificationType-new-topic": "Takip ettiğiniz biri yeni bir konu oluşturduğunda",
"notificationType-new-topic-with-tag": "When a topic is posted with a tag you follow",
"notificationType-new-topic-in-category": "When a topic is posted in a category you are watching",
"notificationType-new-topic-with-tag": "Takip ettiğiniz etiket ile yeni bir başlık oluşturulduğunda",
"notificationType-new-topic-in-category": "Takip ettiğiniz kategoride yeni bir başlık oluşturulduğunda",
"notificationType-new-reply": "Takip ettiğiniz bir konuya yeni bir ileti gönderildiğinde",
"notificationType-post-edit": "Takip ettiğiniz bir konudaki bir ileti değiştirildiğinde",
"notificationType-follow": "Biri sizi takip etmeye başlayınca",
@@ -97,5 +97,5 @@
"notificationType-post-queue": "Yeni bir ileti sıraya alındığında",
"notificationType-new-post-flag": "Bir ileti şikayet edildiğinde",
"notificationType-new-user-flag": "Bir kullanıcı şikayet edildiğinde",
"notificationType-new-reward": "When you earn a new reward"
"notificationType-new-reward": "Yeni bir ödül kazanınca"
}

View File

@@ -8,10 +8,10 @@
"no-tags": "Henüz etiket yok.",
"select-tags": "Etiketleri Seç",
"tag-whitelist": "Kullanılabilir etiket listesi",
"watching": "Watching",
"not-watching": "Not Watching",
"watching.description": "Notify me of new topics.",
"not-watching.description": "Do not notify me of new topics.",
"following-tag.message": "You will now be receiving notifications when somebody posts a topic with this tag.",
"not-following-tag.message": "You will not receive notifications when somebody posts a topic with this tag."
"watching": "Takip ediliyor",
"not-watching": "Takip edilmiyor",
"watching.description": "Yeni başlıkları bildir",
"not-watching.description": "Yeni başlıkları bildirme",
"following-tag.message": "Bu etiket ile yeni bir başlık oluşturulduğunda bildirim alacaksınız!",
"not-following-tag.message": "Bu etiket ile yeni bir başlık oluşturulduğunda bildirim almayacaksınız!"
}

View File

@@ -463,7 +463,9 @@ module.exports = function (utils, load, warn) {
* @returns {string}
*/
Translator.escape = function escape(text) {
return typeof text === 'string' ? text.replace(/\[\[/g, '&lsqb;&lsqb;').replace(/\]\]/g, '&rsqb;&rsqb;') : text;
return typeof text === 'string' ?
text.replace(/\[\[/g, '&lsqb;&lsqb;').replace(/\]\]/g, '&rsqb;&rsqb;') :
text;
};
/**
@@ -473,8 +475,7 @@ module.exports = function (utils, load, warn) {
*/
Translator.unescape = function unescape(text) {
return typeof text === 'string' ?
text.replace(/&lsqb;/g, '[').replace(/\\\[/g, '[')
.replace(/&rsqb;/g, ']').replace(/\\\]/g, ']') :
text.replace(/&rsqb;&rsqb;/g, ']]').replace(/&lsqb;&lsqb;/g, '[[') :
text;
};

View File

@@ -1,6 +1,5 @@
'use strict';
const user = require('../user');
const plugins = require('../plugins');
const helpers = require('./helpers');
@@ -27,17 +26,5 @@ async function doBuildHeader(req, res) {
}
await plugins.hooks.fire('filter:middleware.buildHeader', { req: req, locals: res.locals });
const [config, canLoginIfBanned] = await Promise.all([
controllers.api.loadConfig(req),
user.bans.canLoginIfBanned(req.uid),
]);
if (!canLoginIfBanned && req.loggedIn) {
req.logout(() => {
res.redirect('/');
});
return;
}
res.locals.config = config;
res.locals.config = await controllers.api.loadConfig(req);
}

View File

@@ -221,6 +221,20 @@ module.exports = function (middleware) {
controllers.helpers.redirect(res, path);
});
middleware.redirectToHomeIfBanned = helpers.try(async (req, res, next) => {
if (req.loggedIn) {
const canLoginIfBanned = await user.bans.canLoginIfBanned(req.uid);
if (!canLoginIfBanned) {
req.logout(() => {
res.redirect('/');
});
return;
}
}
next();
});
middleware.requireUser = function (req, res, next) {
if (req.loggedIn) {
return next();

View File

@@ -18,6 +18,7 @@ helpers.setupPageRoute = function (...args) {
middlewares = [
middleware.applyBlacklist,
middleware.authenticateRequest,
middleware.redirectToHomeIfBanned,
middleware.maintenanceMode,
middleware.registrationComplete,
middleware.pluginHooks,

View File

@@ -308,10 +308,6 @@ describe('Translator static methods', () => {
describe('.unescape', () => {
it('should unescape escaped translation patterns within text', (done) => {
assert.strictEqual(
Translator.unescape('some nice text \\[\\[global:home\\]\\] here'),
'some nice text [[global:home]] here'
);
assert.strictEqual(
Translator.unescape('some nice text &lsqb;&lsqb;global:home&rsqb;&rsqb; here'),
'some nice text [[global:home]] here'