diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2023-06-05 19:04:30 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2023-06-05 19:04:30 +0000 |
| commit | 624af7ed00b0edb2792f84cc83f6eeb7568798c4 (patch) | |
| tree | 388afbb88433ae050a6d50f78647623a39a297f2 /src/components | |
| parent | ae5181d21eefecc0167e2a076e6c8ad44f3ca859 (diff) | |
| parent | 0109724a5f16e58a78ab4c09c955c44982368c6f (diff) | |
Merge branch 'harden-parser' into 'develop'
fix regex misinterpreting tag name in badly formed HTML
See merge request pleroma/pleroma-fe!1835
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/rich_content/rich_content.jsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index 7881e365..b16ab242 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -149,7 +149,9 @@ export default { // Handle tag nodes if (Array.isArray(item)) { const [opener, children, closer] = item - const Tag = getTagName(opener) + let Tag = getTagName(opener) + if (Tag.toLowerCase() === 'script') Tag = 'js-exploit' + if (Tag.toLowerCase() === 'style') Tag = 'css-exploit' const fullAttrs = getAttrs(opener, () => true) const attrs = getAttrs(opener) const previouslyMentions = currentMentions !== null |
