From 1cf3dd88ad044c33ce4fdf256d0a3a151343c42a Mon Sep 17 00:00:00 2001 From: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com> Date: Fri, 5 Mar 2021 03:26:07 +0530 Subject: [PATCH 1/7] [FIX] Stopping Jitsi reload (#20973) * removing dep from useMemo * Avoid missing dep in useMemo Co-authored-by: Tasso Evangelista --- client/views/room/contextualBar/Call/Jitsi/CallJitsi.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/views/room/contextualBar/Call/Jitsi/CallJitsi.js b/client/views/room/contextualBar/Call/Jitsi/CallJitsi.js index 697a48ebd264..a8aa73d478d8 100644 --- a/client/views/room/contextualBar/Call/Jitsi/CallJitsi.js +++ b/client/views/room/contextualBar/Call/Jitsi/CallJitsi.js @@ -105,12 +105,13 @@ const CallJitsWithData = ({ rid }) => { } }, [connected, handleClose]); + const rname = useHashName ? uniqueID + rid : encodeURIComponent(room.t === 'd' ? room.usernames.join(' x ') : room.name); + const jitsi = useMemo(() => { if (isEnabledTokenAuth && ! accessToken) { return; } - const rname = useHashName ? uniqueID + rid : encodeURIComponent(room.t === 'd' ? room.usernames.join(' x ') : room.name); const jitsiRoomName = prefix + rname + sufix; return new JitsiBridge({ @@ -122,7 +123,7 @@ const CallJitsWithData = ({ rid }) => { desktopSharingChromeExtId, name: user.name || user.username, }, HEARTBEAT); - }, [accessToken, desktopSharingChromeExtId, domain, isEnabledTokenAuth, openNewWindow, prefix, rid, room.name, room.t, room.usernames, ssl, sufix, uniqueID, useHashName, user.name, user.username]); + }, [accessToken, desktopSharingChromeExtId, domain, isEnabledTokenAuth, openNewWindow, prefix, rname, ssl, sufix, user.name, user.username]); const testAndHandleTimeout = useMutableCallback(() => { if (new Date() - new Date(room.jitsiTimeout) > TIMEOUT) { From 1b47ebbb6f1c29fcd18dc256b2769901cb175081 Mon Sep 17 00:00:00 2001 From: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com> Date: Fri, 5 Mar 2021 04:43:36 +0530 Subject: [PATCH 2/7] [IMPROVE] Close Call contextual bar after starting Jitsi call (#21004) Co-authored-by: Tasso Evangelista --- client/views/room/contextualBar/Call/Jitsi/CallJitsi.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/views/room/contextualBar/Call/Jitsi/CallJitsi.js b/client/views/room/contextualBar/Call/Jitsi/CallJitsi.js index a8aa73d478d8..ed2ef75d7094 100644 --- a/client/views/room/contextualBar/Call/Jitsi/CallJitsi.js +++ b/client/views/room/contextualBar/Call/Jitsi/CallJitsi.js @@ -153,6 +153,9 @@ const CallJitsWithData = ({ rid }) => { const handleYes = useMutableCallback(() => { setAccepted(true); + if (openNewWindow) { + handleClose(); + } }); useLayoutEffect(() => { From 08767c441b4e78b2f0066dd339409a91f78e5e6a Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Mon, 8 Mar 2021 09:30:34 -0300 Subject: [PATCH 3/7] [FIX] Missing spaces on attachment (#21020) --- .../Message/Attachments/DefaultAttachment.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/components/Message/Attachments/DefaultAttachment.tsx b/client/components/Message/Attachments/DefaultAttachment.tsx index fa3fb03a3d97..f67faa1540cd 100644 --- a/client/components/Message/Attachments/DefaultAttachment.tsx +++ b/client/components/Message/Attachments/DefaultAttachment.tsx @@ -57,7 +57,15 @@ export const DefaultAttachment: FC = (attachment) => { {!collapsed && <> {attachment.text && {applyMardownFor('text', attachment.text)}} {/* {attachment.fields && ({ ...rest, value: })) : attachment.fields} />} */} - {attachment.fields && ({ ...rest, value: }))} />} + {attachment.fields && { + const cleanValue = (value as string).replace(/(.*)/g, (line: string) => { + if (line.trim() === '') { + return `${ line }
`; + } + return `${ line } `; + }); + return { ...rest, value: }; + })} />} {attachment.image_url && } {/* DEPRECATED */} {isActionAttachment(attachment) && } From f2817c056f9c063dd5f596446ef2e6c61634233b Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 8 Mar 2021 09:32:31 -0300 Subject: [PATCH 4/7] Bump version to 3.12.1 --- .docker/Dockerfile.rhel | 2 +- .github/history.json | 99 ++++++++++++++++++++++++++ .snapcraft/resources/prepareRocketChat | 2 +- .snapcraft/snap/snapcraft.yaml | 2 +- HISTORY.md | 64 +++++++++++++++++ app/utils/rocketchat.info | 2 +- package-lock.json | 2 +- package.json | 2 +- 8 files changed, 169 insertions(+), 6 deletions(-) diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index f1ee9d09833d..91a1248b77f3 100644 --- a/.docker/Dockerfile.rhel +++ b/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 3.12.0 +ENV RC_VERSION 3.12.1 MAINTAINER buildmaster@rocket.chat diff --git a/.github/history.json b/.github/history.json index f977956d1a66..7ec96d179520 100644 --- a/.github/history.json +++ b/.github/history.json @@ -56582,6 +56582,105 @@ "4.0" ], "pull_requests": [] + }, + "3.10.6": { + "node_version": "12.18.4", + "npm_version": "6.14.8", + "apps_engine_version": "1.21.0-alpha.4235", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [] + }, + "3.11.2": { + "node_version": "12.18.4", + "npm_version": "6.14.8", + "apps_engine_version": "1.22.2", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [ + { + "pr": "20727", + "title": "[FIX] Room owner not being able to override global retention policy", + "userLogin": "g-thome", + "description": "use correct permissions to check if room owner can override global retention policy", + "milestone": "3.11.2", + "contributors": [ + "g-thome" + ] + }, + { + "pr": "20860", + "title": "[FIX] Prevent Message Attachment rendering", + "userLogin": "ggazzo", + "milestone": "3.11.2", + "contributors": [ + "ggazzo" + ] + }, + { + "pr": "20740", + "title": "[FIX] External systems not being able to change Omnichannel Inquiry priorities ", + "userLogin": "renatobecker", + "description": "Due to a wrong property name, external applications were not able to change the priority of Omnichannel Inquires.", + "milestone": "3.11.2", + "contributors": [ + "renatobecker" + ] + } + ] + }, + "3.12.1": { + "node_version": "12.18.4", + "npm_version": "6.14.8", + "apps_engine_version": "1.23.0", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [ + { + "pr": "21020", + "title": "[FIX] Missing spaces on attachment ", + "userLogin": "dougfabris", + "milestone": "3.12.1", + "contributors": [ + "dougfabris", + "tassoevan", + "web-flow" + ] + }, + { + "pr": "21004", + "title": "[IMPROVE] Close Call contextual bar after starting jitsi call.", + "userLogin": "yash-rajpal", + "description": "After jitsi call is started, if the call is started in a new window then we should close contextual tab bar.\r\nSo, when 'YES' is pressed on modal, we call handleClose function if openNewWindow is true, as call doesn't starts on tab bar, it starts on new window.", + "milestone": "3.12.1", + "contributors": [ + "yash-rajpal", + "tassoevan", + "web-flow" + ] + }, + { + "pr": "20973", + "title": "[FIX] Stopping Jitsi reload", + "userLogin": "yash-rajpal", + "description": "The Function where Jitsi call is started gets called many times due to `room.usernames` dep of useMemo, this dep triggers reloading of this function many times.\r\nSo removing this dep from useMemo dependencies", + "milestone": "3.12.1", + "contributors": [ + "yash-rajpal", + "tassoevan", + "web-flow" + ] + } + ] } } } \ No newline at end of file diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat index 3f301ad8afae..646651938802 100755 --- a/.snapcraft/resources/prepareRocketChat +++ b/.snapcraft/resources/prepareRocketChat @@ -1,6 +1,6 @@ #!/bin/bash -curl -SLf "https://releases.rocket.chat/3.12.0/download/" -o rocket.chat.tgz +curl -SLf "https://releases.rocket.chat/3.12.1/download/" -o rocket.chat.tgz tar xf rocket.chat.tgz --strip 1 diff --git a/.snapcraft/snap/snapcraft.yaml b/.snapcraft/snap/snapcraft.yaml index 9e964854b543..c61d4b1d3ff4 100644 --- a/.snapcraft/snap/snapcraft.yaml +++ b/.snapcraft/snap/snapcraft.yaml @@ -7,7 +7,7 @@ # 5. `snapcraft snap` name: rocketchat-server -version: 3.12.0 +version: 3.12.1 summary: Rocket.Chat server description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/ confinement: strict diff --git a/HISTORY.md b/HISTORY.md index 6e481b3268ea..e1291b1d8611 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,40 @@ +# 3.12.1 +`2021-03-08 ยท 1 ๐Ÿš€ ยท 2 ๐Ÿ› ยท 3 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### Engine versions +- Node: `12.18.4` +- NPM: `6.14.8` +- MongoDB: `3.4, 3.6, 4.0` +- Apps-Engine: `1.23.0` + +### ๐Ÿš€ Improvements + + +- Close Call contextual bar after starting jitsi call. ([#21004](https://github.com/RocketChat/Rocket.Chat/pull/21004) by [@yash-rajpal](https://github.com/yash-rajpal)) + + After jitsi call is started, if the call is started in a new window then we should close contextual tab bar. + So, when 'YES' is pressed on modal, we call handleClose function if openNewWindow is true, as call doesn't starts on tab bar, it starts on new window. + +### ๐Ÿ› Bug fixes + + +- Missing spaces on attachment ([#21020](https://github.com/RocketChat/Rocket.Chat/pull/21020)) + +- Stopping Jitsi reload ([#20973](https://github.com/RocketChat/Rocket.Chat/pull/20973) by [@yash-rajpal](https://github.com/yash-rajpal)) + + The Function where Jitsi call is started gets called many times due to `room.usernames` dep of useMemo, this dep triggers reloading of this function many times. + So removing this dep from useMemo dependencies + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Contributors ๐Ÿ˜ + +- [@yash-rajpal](https://github.com/yash-rajpal) + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@dougfabris](https://github.com/dougfabris) +- [@tassoevan](https://github.com/tassoevan) + # 3.12.0 `2021-02-28 ยท 5 ๐ŸŽ‰ ยท 17 ๐Ÿš€ ยท 74 ๐Ÿ› ยท 30 ๐Ÿ” ยท 29 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` @@ -538,6 +574,34 @@ - [@tassoevan](https://github.com/tassoevan) - [@tiagoevanp](https://github.com/tiagoevanp) +# 3.11.2 +`2021-02-28 ยท 3 ๐Ÿ› ยท 3 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### Engine versions +- Node: `12.18.4` +- NPM: `6.14.8` +- MongoDB: `3.4, 3.6, 4.0` +- Apps-Engine: `1.22.2` + +### ๐Ÿ› Bug fixes + + +- External systems not being able to change Omnichannel Inquiry priorities ([#20740](https://github.com/RocketChat/Rocket.Chat/pull/20740)) + + Due to a wrong property name, external applications were not able to change the priority of Omnichannel Inquires. + +- Prevent Message Attachment rendering ([#20860](https://github.com/RocketChat/Rocket.Chat/pull/20860)) + +- Room owner not being able to override global retention policy ([#20727](https://github.com/RocketChat/Rocket.Chat/pull/20727)) + + use correct permissions to check if room owner can override global retention policy + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@g-thome](https://github.com/g-thome) +- [@ggazzo](https://github.com/ggazzo) +- [@renatobecker](https://github.com/renatobecker) + # 3.11.1 `2021-02-10 ยท 5 ๐Ÿ› ยท 6 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info index 936af68f3ebd..ba8a5d2e83f6 100644 --- a/app/utils/rocketchat.info +++ b/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "3.12.0" + "version": "3.12.1" } diff --git a/package-lock.json b/package-lock.json index f38ca178f53c..d8208fb30276 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Rocket.Chat", - "version": "3.12.0", + "version": "3.12.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6b46129c98a6..a308ef22c7ce 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "3.12.0", + "version": "3.12.1", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" From 281d114c45eb314604e35cd3e3b212324c1060a4 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 26 Mar 2021 20:30:12 -0300 Subject: [PATCH 5/7] Bump version to 3.12.2 --- .docker/Dockerfile.rhel | 2 +- .github/history-manual.json | 16 ++++ .github/history.json | 44 ++++++++++ .snapcraft/resources/prepareRocketChat | 2 +- .snapcraft/snap/snapcraft.yaml | 2 +- HISTORY.md | 23 ++++++ app/api/server/v1/users.js | 3 +- .../server/methods/insertOrUpdateEmoji.js | 2 + .../server/methods/uploadEmojiCustom.js | 18 +++- app/mailer/server/api.js | 3 +- app/mailer/server/utils.js | 1 + app/mailer/tests/api.tests.js | 66 +++++++++++++++ app/utils/rocketchat.info | 2 +- .../CustomFieldsAdditionalForm.js | 8 +- package-lock.json | 82 ++++++++++--------- package.json | 4 +- 16 files changed, 230 insertions(+), 48 deletions(-) create mode 100644 app/mailer/server/utils.js create mode 100644 app/mailer/tests/api.tests.js diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index 91a1248b77f3..83307eb4e69f 100644 --- a/.docker/Dockerfile.rhel +++ b/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 3.12.1 +ENV RC_VERSION 3.12.2 MAINTAINER buildmaster@rocket.chat diff --git a/.github/history-manual.json b/.github/history-manual.json index da4c6418600d..d92753b6165f 100644 --- a/.github/history-manual.json +++ b/.github/history-manual.json @@ -63,5 +63,21 @@ "contributors": [ "sampaiodiego" ] + }], + "3.12.2": [{ + "title": "[FIX] Bump Livechat widget", + "userLogin": "sampaiodiego", + "contributors": [ + "sampaiodiego" + ] + }, { + "title": "[FIX] Security Hotfix (https://docs.rocket.chat/guides/security/security-updates)", + "userLogin": "sampaiodiego", + "contributors": [ + "sampaiodiego", + "g-thome", + "KevLehman", + "matheusbsilva137" + ] }] } diff --git a/.github/history.json b/.github/history.json index 7ec96d179520..1c276f4d1c09 100644 --- a/.github/history.json +++ b/.github/history.json @@ -56681,6 +56681,50 @@ ] } ] + }, + "3.8.9": { + "node_version": "12.18.4", + "npm_version": "6.14.8", + "apps_engine_version": "1.19.0", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [] + }, + "3.10.7": { + "node_version": "12.18.4", + "npm_version": "6.14.8", + "apps_engine_version": "1.21.0-alpha.4235", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [] + }, + "3.11.3": { + "node_version": "12.18.4", + "npm_version": "6.14.8", + "apps_engine_version": "1.22.2", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [] + }, + "3.12.2": { + "node_version": "12.18.4", + "npm_version": "6.14.8", + "apps_engine_version": "1.23.0", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [] } } } \ No newline at end of file diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat index 646651938802..f9d8ecb04eb5 100755 --- a/.snapcraft/resources/prepareRocketChat +++ b/.snapcraft/resources/prepareRocketChat @@ -1,6 +1,6 @@ #!/bin/bash -curl -SLf "https://releases.rocket.chat/3.12.1/download/" -o rocket.chat.tgz +curl -SLf "https://releases.rocket.chat/3.12.2/download/" -o rocket.chat.tgz tar xf rocket.chat.tgz --strip 1 diff --git a/.snapcraft/snap/snapcraft.yaml b/.snapcraft/snap/snapcraft.yaml index c61d4b1d3ff4..f67e131b0878 100644 --- a/.snapcraft/snap/snapcraft.yaml +++ b/.snapcraft/snap/snapcraft.yaml @@ -7,7 +7,7 @@ # 5. `snapcraft snap` name: rocketchat-server -version: 3.12.1 +version: 3.12.2 summary: Rocket.Chat server description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/ confinement: strict diff --git a/HISTORY.md b/HISTORY.md index e1291b1d8611..e6ed3543522d 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,27 @@ +# 3.12.2 +`2021-03-26 ยท 2 ๐Ÿ› ยท 4 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### Engine versions +- Node: `12.18.4` +- NPM: `6.14.8` +- MongoDB: `3.4, 3.6, 4.0` +- Apps-Engine: `1.23.0` + +### ๐Ÿ› Bug fixes + + +- Bump Livechat widget + +- Security Hotfix (https://docs.rocket.chat/guides/security/security-updates) + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@KevLehman](https://github.com/KevLehman) +- [@g-thome](https://github.com/g-thome) +- [@matheusbsilva137](https://github.com/matheusbsilva137) +- [@sampaiodiego](https://github.com/sampaiodiego) + # 3.12.1 `2021-03-08 ยท 1 ๐Ÿš€ ยท 2 ๐Ÿ› ยท 3 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` diff --git a/app/api/server/v1/users.js b/app/api/server/v1/users.js index a7d99d933c72..e69b6505d899 100644 --- a/app/api/server/v1/users.js +++ b/app/api/server/v1/users.js @@ -722,7 +722,8 @@ API.v1.addRoute('users.2fa.sendEmailCode', { const userId = this.userId || Users[method](emailOrUsername, { fields: { _id: 1 } })?._id; if (!userId) { - throw new Meteor.Error('error-invalid-user', 'Invalid user'); + this.logger.error('[2fa] User was not found when requesting 2fa email code'); + return API.v1.success(); } emailCheck.sendEmailCode(getUserForCheck(userId)); diff --git a/app/emoji-custom/server/methods/insertOrUpdateEmoji.js b/app/emoji-custom/server/methods/insertOrUpdateEmoji.js index 72a0a6a0694f..e635265e1f02 100644 --- a/app/emoji-custom/server/methods/insertOrUpdateEmoji.js +++ b/app/emoji-custom/server/methods/insertOrUpdateEmoji.js @@ -45,6 +45,8 @@ Meteor.methods({ emojiData.aliases = []; } + emojiData.extension = emojiData.extension === 'svg+xml' ? 'png' : emojiData.extension; + let matchingResults = []; if (emojiData._id) { diff --git a/app/emoji-custom/server/methods/uploadEmojiCustom.js b/app/emoji-custom/server/methods/uploadEmojiCustom.js index 1f3d4cf4d1c4..685d4f0270ae 100644 --- a/app/emoji-custom/server/methods/uploadEmojiCustom.js +++ b/app/emoji-custom/server/methods/uploadEmojiCustom.js @@ -1,13 +1,24 @@ import { Meteor } from 'meteor/meteor'; import limax from 'limax'; +import sharp from 'sharp'; import { hasPermission } from '../../../authorization'; import { RocketChatFile } from '../../../file'; import { RocketChatFileEmojiCustomInstance } from '../startup/emoji-custom'; import { api } from '../../../../server/sdk/api'; +const getFile = async (file, extension) => { + if (extension !== 'svg+xml') { + return file; + } + + return sharp(file) + .png() + .toBuffer(); +}; + Meteor.methods({ - uploadEmojiCustom(binaryContent, contentType, emojiData) { + async uploadEmojiCustom(binaryContent, contentType, emojiData) { if (!hasPermission(this.userId, 'manage-emoji')) { throw new Meteor.Error('not_authorized'); } @@ -15,7 +26,10 @@ Meteor.methods({ emojiData.name = limax(emojiData.name, { replacement: '_' }); // delete aliases for notification purposes. here, it is a string rather than an array delete emojiData.aliases; - const file = new Buffer(binaryContent, 'binary'); + + const file = await getFile(Buffer.from(binaryContent, 'binary'), emojiData.extension); + + emojiData.extension = emojiData.extension === 'svg+xml' ? 'png' : emojiData.extension; const rs = RocketChatFile.bufferToStream(file); RocketChatFileEmojiCustomInstance.deleteFile(encodeURIComponent(`${ emojiData.name }.${ emojiData.extension }`)); diff --git a/app/mailer/server/api.js b/app/mailer/server/api.js index 395af628b7d1..26839474bc01 100644 --- a/app/mailer/server/api.js +++ b/app/mailer/server/api.js @@ -8,6 +8,7 @@ import stripHtml from 'string-strip-html'; import { settings } from '../../settings/server'; import { escapeHTML } from '../../../lib/escapeHTML'; +import { replaceVariables } from './utils.js'; let contentHeader; let contentFooter; @@ -25,7 +26,7 @@ settings.get('Language', (key, value) => { }); export const replacekey = (str, key, value = '') => str.replace(new RegExp(`(\\[${ key }\\]|__${ key }__)`, 'igm'), escapeHTML(value)); -export const translate = (str) => str.replace(/\{ ?([^\} ]+)(( ([^\}]+))+)? ?\}/gmi, (match, key) => TAPi18n.__(key, { lng })); +export const translate = (str) => replaceVariables(str, (match, key) => TAPi18n.__(key, { lng })); export const replace = function replace(str, data = {}) { if (!str) { return ''; diff --git a/app/mailer/server/utils.js b/app/mailer/server/utils.js new file mode 100644 index 000000000000..796215bd89c7 --- /dev/null +++ b/app/mailer/server/utils.js @@ -0,0 +1 @@ +export const replaceVariables = (str, callback) => str.replace(/\{ *([^\{\} ]+)[^\{\}]*\}/gmi, callback); diff --git a/app/mailer/tests/api.tests.js b/app/mailer/tests/api.tests.js new file mode 100644 index 000000000000..6ecf3b9f9de1 --- /dev/null +++ b/app/mailer/tests/api.tests.js @@ -0,0 +1,66 @@ +/* eslint-env mocha */ +import assert from 'assert'; + +import { replaceVariables } from '../server/utils.js'; + +describe('Mailer-API', function() { + describe('translate', () => { + const i18n = { + key: 'value', + }; + + describe('single key', function functionName() { + it(`should be equal to test ${ i18n.key }`, () => { + assert.equal(`test ${ i18n.key }`, replaceVariables('test {key}', (match, key) => i18n[key])); + }); + }); + + describe('multiple keys', function functionName() { + it(`should be equal to test ${ i18n.key } and ${ i18n.key }`, () => { + assert.equal(`test ${ i18n.key } and ${ i18n.key }`, replaceVariables('test {key} and {key}', (match, key) => i18n[key])); + }); + }); + + describe('key with a trailing space', function functionName() { + it(`should be equal to test ${ i18n.key }`, () => { + assert.equal(`test ${ i18n.key }`, replaceVariables('test {key }', (match, key) => i18n[key])); + }); + }); + + describe('key with a leading space', function functionName() { + it(`should be equal to test ${ i18n.key }`, () => { + assert.equal(`test ${ i18n.key }`, replaceVariables('test { key}', (match, key) => i18n[key])); + }); + }); + + describe('key with leading and trailing spaces', function functionName() { + it(`should be equal to test ${ i18n.key }`, () => { + assert.equal(`test ${ i18n.key }`, replaceVariables('test { key }', (match, key) => i18n[key])); + }); + }); + + describe('key with multiple words', function functionName() { + it(`should be equal to test ${ i18n.key }`, () => { + assert.equal(`test ${ i18n.key }`, replaceVariables('test {key ignore}', (match, key) => i18n[key])); + }); + }); + + describe('key with multiple opening brackets', function functionName() { + it(`should be equal to test {${ i18n.key }`, () => { + assert.equal(`test {${ i18n.key }`, replaceVariables('test {{key}', (match, key) => i18n[key])); + }); + }); + + describe('key with multiple closing brackets', function functionName() { + it(`should be equal to test ${ i18n.key }}`, () => { + assert.equal(`test ${ i18n.key }}`, replaceVariables('test {key}}', (match, key) => i18n[key])); + }); + }); + + describe('key with multiple opening and closing brackets', function functionName() { + it(`should be equal to test {${ i18n.key }}`, () => { + assert.equal(`test {${ i18n.key }}`, replaceVariables('test {{key}}', (match, key) => i18n[key])); + }); + }); + }); +}); diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info index ba8a5d2e83f6..1d40d73f2915 100644 --- a/app/utils/rocketchat.info +++ b/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "3.12.1" + "version": "3.12.2" } diff --git a/ee/client/omnichannel/additionalForms/CustomFieldsAdditionalForm.js b/ee/client/omnichannel/additionalForms/CustomFieldsAdditionalForm.js index d728bb08933b..425037cd9f02 100644 --- a/ee/client/omnichannel/additionalForms/CustomFieldsAdditionalForm.js +++ b/ee/client/omnichannel/additionalForms/CustomFieldsAdditionalForm.js @@ -12,7 +12,13 @@ const getInitialValues = (data) => ({ public: !!data.public, }); -const checkInvalidOptions = (value) => value.trim() !== '' && !/^([a-zA-Z0-9-_ ]+)(,\s*[a-zA-Z0-9-_ ]+)*$/i.test(value); +const checkInvalidOptions = (value) => { + if (!value || value.trim() === '') { + return false; + } + + return value.split(',').every((v) => /^[a-zA-Z0-9-_ ]+$/.test(v)); +}; const CustomFieldsAdditionalFormContainer = ({ data = {}, state, onChange, className }) => { const t = useTranslation(); diff --git a/package-lock.json b/package-lock.json index d8208fb30276..7a6601b14300 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Rocket.Chat", - "version": "3.12.1", + "version": "3.12.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -5917,6 +5917,13 @@ "semver": "^5.5.0", "stack-trace": "0.0.10", "uuid": "^3.2.1" + }, + "dependencies": { + "adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==" + } } }, "@rocket.chat/css-in-js": { @@ -6040,9 +6047,9 @@ "integrity": "sha512-5NsrdR3C90Z0lR7OkgzHGqjDVPxho+LUjrv15F1L/uONp/WdQBo+Z3cGFXUgnLZf5ohX1BgTRRtzHtJPPr7QyQ==" }, "@rocket.chat/livechat": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@rocket.chat/livechat/-/livechat-1.8.0.tgz", - "integrity": "sha512-ZSONa2ty9LYel9p8dx/Ba4mTxJn6YJaG5E61w6UcJ73cAkVvmLJCTp9pg6cf/FAHXGa/1g863qxlCA6pOYGFFw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@rocket.chat/livechat/-/livechat-1.9.0.tgz", + "integrity": "sha512-4VbwxCfcX18Ulk63ySHiND1DfEXIRPOPJbQAWfQuFvtggB3QkpkLuPaDevW++wFBwMl4Gy3BAOgTwq3d9AVCyw==", "dev": true, "requires": { "@kossnocorp/desvg": "^0.2.0", @@ -6051,6 +6058,7 @@ "css-vars-ponyfill": "^2.3.2", "date-fns": "^2.15.0", "desvg": "^1.0.2", + "dompurify": "^2.2.6", "emoji-mart": "^3.0.0", "history": "^5.0.0", "i18nline": "^2.0.1", @@ -6071,9 +6079,9 @@ "dev": true }, "query-string": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.0.tgz", - "integrity": "sha512-In3o+lUxlgejoVJgwEdYtdxrmlL0cQWJXj0+kkI7RWVo7hg5AhFtybeKlC9Dpgbr8eOC4ydpEh8017WwyfzqVQ==", + "version": "6.14.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz", + "integrity": "sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==", "dev": true, "requires": { "decode-uri-component": "^0.2.0", @@ -6083,9 +6091,9 @@ } }, "whatwg-fetch": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.1.tgz", - "integrity": "sha512-IEmN/ZfmMw6G1hgZpVd0LuZXOQDisrMOZrzYd5x3RAK4bMPlJohKUZWZ9t/QsTvH0dV9TbPDcc2OSuIDcihnHA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", + "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==", "dev": true } } @@ -17289,9 +17297,9 @@ "integrity": "sha512-lcWy3AXDRJOD7MplwZMmNSRM//kZtJaLz4n6D1P5z9wEmZGBKhJRBIr1Xs9KNQJmdXPblvgffynYji4iylUTcA==" }, "date-fns": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.17.0.tgz", - "integrity": "sha512-ZEhqxUtEZeGgg9eHNSOAJ8O9xqSgiJdrL0lzSSfMF54x6KXWJiOH/xntSJ9YomJPrYH/p08t6gWjGWq1SDJlSA==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.19.0.tgz", + "integrity": "sha512-X3bf2iTPgCAQp9wvjOQytnf5vO5rESYRXlPIVcgSbtT5OTScPcsf9eZU+B/YIkKAtYr5WeCii58BgATrNitlWg==", "dev": true }, "date-now": { @@ -17927,9 +17935,9 @@ "integrity": "sha1-BpYswKRCFnWbo7mOOyV3wM4w/Aw=" }, "emoji-mart": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emoji-mart/-/emoji-mart-3.0.0.tgz", - "integrity": "sha512-r5DXyzOLJttdwRYfJmPq/XL3W5tiAE/VsRnS0Hqyn27SqPA/GOYwVUSx50px/dXdJyDSnvmoPbuJ/zzhwSaU4A==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/emoji-mart/-/emoji-mart-3.0.1.tgz", + "integrity": "sha512-sxpmMKxqLvcscu6mFn9ITHeZNkGzIvD0BSNFE/LJESPbCA8s1jM6bCDPjWbV31xHq7JXaxgpHxLB54RCbBZSlg==", "dev": true, "requires": { "@babel/runtime": "^7.0.0", @@ -19929,7 +19937,7 @@ }, "chownr": { "version": "1.1.1", - "resolved": "", + "resolved": false, "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "dev": true, "optional": true @@ -19964,7 +19972,7 @@ }, "debug": { "version": "4.1.1", - "resolved": "", + "resolved": false, "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "optional": true, @@ -19995,7 +20003,7 @@ }, "fs-minipass": { "version": "1.2.5", - "resolved": "", + "resolved": false, "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, @@ -20029,7 +20037,7 @@ }, "glob": { "version": "7.1.3", - "resolved": "", + "resolved": false, "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "optional": true, @@ -20061,7 +20069,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": "", + "resolved": false, "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, @@ -20082,7 +20090,7 @@ }, "inherits": { "version": "2.0.3", - "resolved": "", + "resolved": false, "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true, "optional": true @@ -20130,7 +20138,7 @@ }, "minipass": { "version": "2.3.5", - "resolved": "", + "resolved": false, "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, "optional": true, @@ -20141,7 +20149,7 @@ }, "minizlib": { "version": "1.2.1", - "resolved": "", + "resolved": false, "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "dev": true, "optional": true, @@ -20161,7 +20169,7 @@ }, "ms": { "version": "2.1.1", - "resolved": "", + "resolved": false, "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true, "optional": true @@ -20175,7 +20183,7 @@ }, "needle": { "version": "2.3.0", - "resolved": "", + "resolved": false, "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "dev": true, "optional": true, @@ -20187,7 +20195,7 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": "", + "resolved": false, "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "dev": true, "optional": true, @@ -20217,14 +20225,14 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": "", + "resolved": false, "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.1", - "resolved": "", + "resolved": false, "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "dev": true, "optional": true, @@ -20304,7 +20312,7 @@ }, "process-nextick-args": { "version": "2.0.0", - "resolved": "", + "resolved": false, "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true @@ -20349,7 +20357,7 @@ }, "rimraf": { "version": "2.6.3", - "resolved": "", + "resolved": false, "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "optional": true, @@ -20380,7 +20388,7 @@ }, "semver": { "version": "5.7.0", - "resolved": "", + "resolved": false, "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true, "optional": true @@ -20440,7 +20448,7 @@ }, "tar": { "version": "4.4.8", - "resolved": "", + "resolved": false, "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "dev": true, "optional": true, @@ -20480,7 +20488,7 @@ }, "yallist": { "version": "3.0.3", - "resolved": "", + "resolved": false, "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", "dev": true, "optional": true @@ -29557,9 +29565,9 @@ "integrity": "sha1-3F4yN2WYXd/cv9r8MUGpVprvdak=" }, "preact": { - "version": "10.5.12", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.5.12.tgz", - "integrity": "sha512-r6siDkuD36oszwlCkcqDJCAKBQxGoeEGytw2DGMD5A/GGdu5Tymw+N2OBXwvOLxg6d1FeY8MgMV3cc5aVQo4Cg==", + "version": "10.5.13", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.5.13.tgz", + "integrity": "sha512-q/vlKIGNwzTLu+jCcvywgGrt+H/1P/oIRSD6mV4ln3hmlC+Aa34C7yfPI4+5bzW8pONyVXYS7SvXosy2dKKtWQ==", "dev": true }, "preact-i18nline": { diff --git a/package.json b/package.json index a308ef22c7ce..845d48fb499f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "3.12.1", + "version": "3.12.2", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" @@ -56,7 +56,7 @@ "@babel/register": "^7.12.1", "@octokit/rest": "^16.43.2", "@rocket.chat/eslint-config": "^0.3.0", - "@rocket.chat/livechat": "^1.8.0", + "@rocket.chat/livechat": "^1.9.0", "@settlin/spacebars-loader": "^1.0.8", "@storybook/addon-essentials": "^6.1.11", "@storybook/addons": "^6.1.11", From fe768b8a289ce041e4559d91c7e2ea73687545e9 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 26 Mar 2021 23:12:16 -0300 Subject: [PATCH 6/7] Bump version to 3.12.3 --- .docker/Dockerfile.rhel | 2 +- .github/history.json | 11 +++++++++++ .github/workflows/build_and_test.yml | 1 + .snapcraft/resources/prepareRocketChat | 2 +- .snapcraft/snap/snapcraft.yaml | 2 +- app/utils/rocketchat.info | 2 +- package-lock.json | 2 +- package.json | 2 +- 8 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index 83307eb4e69f..de401140e66a 100644 --- a/.docker/Dockerfile.rhel +++ b/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 3.12.2 +ENV RC_VERSION 3.12.3 MAINTAINER buildmaster@rocket.chat diff --git a/.github/history.json b/.github/history.json index 1c276f4d1c09..d3131633f428 100644 --- a/.github/history.json +++ b/.github/history.json @@ -56725,6 +56725,17 @@ "4.0" ], "pull_requests": [] + }, + "3.12.3": { + "node_version": "12.18.4", + "npm_version": "6.14.8", + "apps_engine_version": "1.23.0", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [] } } } \ No newline at end of file diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index e946ee7ee7fd..6faffea2b518 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -394,6 +394,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: 'us-east-1' GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }} REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }} diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat index f9d8ecb04eb5..1a2400c1b8df 100755 --- a/.snapcraft/resources/prepareRocketChat +++ b/.snapcraft/resources/prepareRocketChat @@ -1,6 +1,6 @@ #!/bin/bash -curl -SLf "https://releases.rocket.chat/3.12.2/download/" -o rocket.chat.tgz +curl -SLf "https://releases.rocket.chat/3.12.3/download/" -o rocket.chat.tgz tar xf rocket.chat.tgz --strip 1 diff --git a/.snapcraft/snap/snapcraft.yaml b/.snapcraft/snap/snapcraft.yaml index f67e131b0878..3ca8d18be153 100644 --- a/.snapcraft/snap/snapcraft.yaml +++ b/.snapcraft/snap/snapcraft.yaml @@ -7,7 +7,7 @@ # 5. `snapcraft snap` name: rocketchat-server -version: 3.12.2 +version: 3.12.3 summary: Rocket.Chat server description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/ confinement: strict diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info index 1d40d73f2915..64783cef0fba 100644 --- a/app/utils/rocketchat.info +++ b/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "3.12.2" + "version": "3.12.3" } diff --git a/package-lock.json b/package-lock.json index 7a6601b14300..67c8f25eb389 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Rocket.Chat", - "version": "3.12.2", + "version": "3.12.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 845d48fb499f..6f593c8caaaf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "3.12.2", + "version": "3.12.3", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" From 034ed39756b0172a1e86a5dc021dc75c8d6029a2 Mon Sep 17 00:00:00 2001 From: Shailesh Baldaniya Date: Thu, 1 Apr 2021 10:10:27 +0530 Subject: [PATCH 7/7] Update package-lock.json --- package-lock.json | 107 +--------------------------------------------- 1 file changed, 2 insertions(+), 105 deletions(-) diff --git a/package-lock.json b/package-lock.json index 43ebd7dc643a..7dc55eec86a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6046,7 +6046,7 @@ "integrity": "sha512-5NsrdR3C90Z0lR7OkgzHGqjDVPxho+LUjrv15F1L/uONp/WdQBo+Z3cGFXUgnLZf5ohX1BgTRRtzHtJPPr7QyQ==" }, "@rocket.chat/livechat": { - "version": "git+https://github.com/WideChat/Rocket.Chat.Livechat.git#8917fc84a3a8d0e6b4e16975af069078c1c46340", + "version": "git+https://github.com/WideChat/Rocket.Chat.Livechat.git#bc6f363131eadc89bf6c082a8339452658bed9d8", "from": "git+https://github.com/WideChat/Rocket.Chat.Livechat.git#develop", "dev": true, "requires": { @@ -6056,6 +6056,7 @@ "css-vars-ponyfill": "^2.3.2", "date-fns": "^2.15.0", "desvg": "^1.0.2", + "dompurify": "^2.2.6", "emoji-mart": "^3.0.0", "history": "^5.0.0", "i18nline": "^2.0.1", @@ -6066,7 +6067,6 @@ "preact-i18nline": "^2.0.0", "preact-router": "^3.2.1", "query-string": "^6.13.1", - "sanitize-html": "^1.27.2", "whatwg-fetch": "^3.4.0" }, "dependencies": { @@ -28666,12 +28666,6 @@ "error-ex": "^1.2.0" } }, - "parse-srcset": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-srcset/-/parse-srcset-1.0.2.tgz", - "integrity": "sha1-8r0iH2zJcKk42IVWq8WJyqqiveE=", - "dev": true - }, "parse5": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", @@ -32437,103 +32431,6 @@ } } }, - "sanitize-html": { - "version": "1.27.5", - "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.27.5.tgz", - "integrity": "sha512-M4M5iXDAUEcZKLXkmk90zSYWEtk5NH3JmojQxKxV371fnMh+x9t1rqdmXaGoyEHw3z/X/8vnFhKjGL5xFGOJ3A==", - "dev": true, - "requires": { - "htmlparser2": "^4.1.0", - "lodash": "^4.17.15", - "parse-srcset": "^1.0.2", - "postcss": "^7.0.27" - }, - "dependencies": { - "dom-serializer": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.2.0.tgz", - "integrity": "sha512-n6kZFH/KlCrqs/1GHMOd5i2fd/beQHuehKdWvNNffbGHTr/almdhuVvTVFb3V7fglz+nC50fFusu3lY33h12pA==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^4.0.0", - "entities": "^2.0.0" - }, - "dependencies": { - "domhandler": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.0.0.tgz", - "integrity": "sha512-KPTbnGQ1JeEMQyO1iYXoagsI6so/C96HZiFyByU3T6iAzpXn8EGEvct6unm1ZGoed8ByO2oirxgwxBmqKF9haA==", - "dev": true, - "requires": { - "domelementtype": "^2.1.0" - } - } - } - }, - "domelementtype": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", - "integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==", - "dev": true - }, - "domhandler": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.3.0.tgz", - "integrity": "sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1" - } - }, - "domutils": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.5.0.tgz", - "integrity": "sha512-Ho16rzNMOFk2fPwChGh3D2D9OEHAfG19HgmRR2l+WLSsIstNsAYBzePH412bL0y5T44ejABIVfTHQ8nqi/tBCg==", - "dev": true, - "requires": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.0.1", - "domhandler": "^4.0.0" - }, - "dependencies": { - "domhandler": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.0.0.tgz", - "integrity": "sha512-KPTbnGQ1JeEMQyO1iYXoagsI6so/C96HZiFyByU3T6iAzpXn8EGEvct6unm1ZGoed8ByO2oirxgwxBmqKF9haA==", - "dev": true, - "requires": { - "domelementtype": "^2.1.0" - } - } - } - }, - "entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "dev": true - }, - "htmlparser2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz", - "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^3.0.0", - "domutils": "^2.0.0", - "entities": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - } - } - }, "saslprep": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",