mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-18 09:07:46 +00:00
fix(chat) prevent homograph attacks
Decode URLs using punycode when rendering, so when http://ebаy.com is sent we render http://xn--eby-7cd.com/ instead. Ref: https://github.com/tasti/react-linkify/issues/84
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
0f9e01a7cf
commit
11ae187ece
@@ -1,5 +1,6 @@
|
||||
// @flow
|
||||
|
||||
import punycode from 'punycode';
|
||||
import React, { Component } from 'react';
|
||||
import ReactLinkify from 'react-linkify';
|
||||
import { Text } from 'react-native';
|
||||
@@ -68,7 +69,7 @@ export default class Linkify extends Component<Props> {
|
||||
key = { key }
|
||||
style = { this.props.linkStyle }
|
||||
url = { decoratedHref }>
|
||||
{decoratedText}
|
||||
{ punycode.toASCII(decoratedText) }
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user