diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a0993f03d..294dbd93ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/install/data/defaults.json b/install/data/defaults.json index d60984e99e..47a3e8d4a2 100644 --- a/install/data/defaults.json +++ b/install/data/defaults.json @@ -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 -} \ No newline at end of file +} diff --git a/install/package.json b/install/package.json index 003a896f9f..2dd2ad5e00 100644 --- a/install/package.json +++ b/install/package.json @@ -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", diff --git a/public/language/hy/admin/extend/widgets.json b/public/language/hy/admin/extend/widgets.json index 2c477816ae..a8928471c5 100644 --- a/public/language/hy/admin/extend/widgets.json +++ b/public/language/hy/admin/extend/widgets.json @@ -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", diff --git a/public/language/hy/error.json b/public/language/hy/error.json index 81d84ced2e..eafee7dc2e 100644 --- a/public/language/hy/error.json +++ b/public/language/hy/error.json @@ -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 անգամ կողմ քվեարկել օգտատիրոջը", diff --git a/public/language/tr/notifications.json b/public/language/tr/notifications.json index 7feb6acdf3..9517894245 100644 --- a/public/language/tr/notifications.json +++ b/public/language/tr/notifications.json @@ -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": "%1 size bir mesaj gönderdi", - "new-messages-from": "%1 new messages from %2", - "new-message-in": "New message in %1", - "new-messages-in": "%1 new messages in %2", - "user-posted-in-public-room": "%1 wrote in %3", - "user-posted-in-public-room-dual": "%1 and %2 wrote in %4", - "user-posted-in-public-room-triple": "%1, %2 and %3 wrote in %5", - "user-posted-in-public-room-multiple": "%1, %2 and %3 others wrote in %5", + "new-messages-from": "%2 kullanıcısından %1 yeni mesaj var", + "new-message-in": "%1 odasında yeni mesaj var", + "new-messages-in": "%2 odasında %1 yeni mesaj var", + "user-posted-in-public-room": "%1 şu odaya yazdı: %3", + "user-posted-in-public-room-dual": "%1 ve %2 şu odaya yazdı: %4", + "user-posted-in-public-room-triple": "%1, %2 ve %3 şu odaya yazdılar: %5", + "user-posted-in-public-room-multiple": "%1, %2 ve %3 diğer kullanıcı şu odaya yazdılar: %5", "upvoted-your-post-in": "%1 şu konudaki iletinizi beğendi: %2.", "upvoted-your-post-in-dual": "%1 ve %2 şu konudaki iletinizi beğendi: %3", - "upvoted-your-post-in-triple": "%1, %2 and %3 have upvoted your post in %4.", - "upvoted-your-post-in-multiple": "%1, %2 and %3 others have upvoted your post in %4.", + "upvoted-your-post-in-triple": "%1, %2 ve %3 şu konudaki iletinizi beğendi: %4.", + "upvoted-your-post-in-multiple": "%1, %2 ve %3 diğer kullanıcı şu konudaki iletinizi beğendi: %4.", "moved-your-post": "%1, iletinizi şuraya taşıdı: %2", "moved-your-topic": "%1 şuraya taşındı: %2", "user-flagged-post-in": "%1 şu konudaki bir iletiyi şikayet etti: %2", "user-flagged-post-in-dual": "%1 ve %2 şu konudaki bir iletiyi şikayet etti: %3", - "user-flagged-post-in-triple": "%1, %2 and %3 flagged a post in %4", - "user-flagged-post-in-multiple": "%1, %2 and %3 others flagged a post in %4", - "user-flagged-user": "%1 şu kullanıcının profilini şikayet etti: (%2)", - "user-flagged-user-dual": "%1 ve %2 şu kullanıcının profilini şikayet etti: (%3)", - "user-flagged-user-triple": "%1, %2 and %3 flagged a user profile (%4)", - "user-flagged-user-multiple": "%1, %2 and %3 others flagged a user profile (%4)", + "user-flagged-post-in-triple": "%1, %2 ve %3 şu konudaki bir iletiyi şikayet etti: %4", + "user-flagged-post-in-multiple": "%1, %2 ve %3 diğer kullanıcı şu konudaki bir iletiyi şikayet etti: %4", + "user-flagged-user": "%1 şu kullanıcıyı şikayet etti: (%2)", + "user-flagged-user-dual": "%1 ve %2 şu kullanıcıyı şikayet etti: (%3)", + "user-flagged-user-triple": "%1, %2 ve %3 şu kullanıcıyı şikayet etti: (%4)", + "user-flagged-user-multiple": "%1, %2 ve %3 diğer üye şu kullanıcıyı şikayet etti: (%4)", "user-posted-to": "%1 şu konuya bir ileti yazdı: %2", "user-posted-to-dual": "%1 ve %2 şu konuya ileti yazdılar: %3", - "user-posted-to-triple": "%1, %2 and %3 have posted replies to: %4", - "user-posted-to-multiple": "%1, %2 and %3 others have posted replies to: %4", + "user-posted-to-triple": "%1, %2 ve %3 şu konuya ileti yazdılar: %4", + "user-posted-to-multiple": "%1, %2 ve %3 diğer kullanıcı şu konuya ileti yazdılar: %4", "user-posted-topic": "%1 şu yeni konuyu oluşturdu: %2", "user-edited-post": "%1 şu konudaki bir iletiyi değiştirdi: %2", - "user-posted-topic-with-tag": "%1 has posted a new topic with tag %2", - "user-posted-topic-with-tag-dual": "%1 has posted a new topic with tags %2 and %3", - "user-posted-topic-with-tag-triple": "%1 has posted a new topic with tags %2, %3 and %4", - "user-posted-topic-with-tag-multiple": "%1 has posted a new topic with tags %2", - "user-posted-topic-in-category": "%1 has posted a new topic in %2", + "user-posted-topic-with-tag": "%1 şu etiketi kullanarak yeni bir konu oluşturdu: %2", + "user-posted-topic-with-tag-dual": "%1 şu etiketleri kullanarak yeni bir konu oluşturdu: %2 ve %3", + "user-posted-topic-with-tag-triple": "%1 şu etiketleri kullanarak yeni bir konu oluşturdu: %2, %3 ve %4", + "user-posted-topic-with-tag-multiple": "%1 şu etiketleri kullanarak yeni bir konu oluşturdu: %2", + "user-posted-topic-in-category": "%1 şu kategoride yeni bir başlık oluşturdu: %2", "user-started-following-you": "%1 sizi takip etmeye başladı.", "user-started-following-you-dual": "%1 ve %2 sizi takip etmeye başladı.", "user-started-following-you-triple": "%1, %2 and %3 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" } \ No newline at end of file diff --git a/public/language/tr/tags.json b/public/language/tr/tags.json index 9e39c64eb1..32b174112b 100644 --- a/public/language/tr/tags.json +++ b/public/language/tr/tags.json @@ -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!" } \ No newline at end of file diff --git a/public/src/modules/translator.common.js b/public/src/modules/translator.common.js index 49a3b59c60..c69a9cc265 100644 --- a/public/src/modules/translator.common.js +++ b/public/src/modules/translator.common.js @@ -463,7 +463,9 @@ module.exports = function (utils, load, warn) { * @returns {string} */ Translator.escape = function escape(text) { - return typeof text === 'string' ? text.replace(/\[\[/g, '[[').replace(/\]\]/g, ']]') : text; + return typeof text === 'string' ? + text.replace(/\[\[/g, '[[').replace(/\]\]/g, ']]') : + text; }; /** @@ -473,8 +475,7 @@ module.exports = function (utils, load, warn) { */ Translator.unescape = function unescape(text) { return typeof text === 'string' ? - text.replace(/[/g, '[').replace(/\\\[/g, '[') - .replace(/]/g, ']').replace(/\\\]/g, ']') : + text.replace(/]]/g, ']]').replace(/[[/g, '[[') : text; }; diff --git a/src/middleware/header.js b/src/middleware/header.js index b6c4e47ec0..383ef8e94e 100644 --- a/src/middleware/header.js +++ b/src/middleware/header.js @@ -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); } diff --git a/src/middleware/user.js b/src/middleware/user.js index 1220897ffc..a9573e397c 100644 --- a/src/middleware/user.js +++ b/src/middleware/user.js @@ -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(); diff --git a/src/routes/helpers.js b/src/routes/helpers.js index aff46467ec..b43f53fd3e 100644 --- a/src/routes/helpers.js +++ b/src/routes/helpers.js @@ -18,6 +18,7 @@ helpers.setupPageRoute = function (...args) { middlewares = [ middleware.applyBlacklist, middleware.authenticateRequest, + middleware.redirectToHomeIfBanned, middleware.maintenanceMode, middleware.registrationComplete, middleware.pluginHooks, diff --git a/test/translator.js b/test/translator.js index 6e34012a7a..61c3d5af8e 100644 --- a/test/translator.js +++ b/test/translator.js @@ -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 [[global:home]] here'), 'some nice text [[global:home]] here'