mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-13 11:45:45 +03:00
Merge branch 'mp/jank-regex' (#2813)
* origin/mp/jank-regex: chat: strictly match URLs in outgoing strings Signed-off-by: Matilde Park <matilde@tlon.io>
This commit is contained in:
commit
048de06f76
@ -174,7 +174,7 @@ export class ChatInput extends Component {
|
|||||||
|
|
||||||
isUrl(string) {
|
isUrl(string) {
|
||||||
try {
|
try {
|
||||||
const websiteTest = new RegExp(String(/((\w+:\/\/)[-a-zA-Z0-9:@;?&=\/%\+\.\*!'\(\),\$_\{\}\^~\[\]`#|]+)/.source)
|
const websiteTest = new RegExp(String(/^((\w+:\/\/)[-a-zA-Z0-9:@;?&=\/%\+\.\*!'\(\),\$_\{\}\^~\[\]`#|]+)/.source)
|
||||||
);
|
);
|
||||||
return websiteTest.test(string);
|
return websiteTest.test(string);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user