Use native escaping for hashtag URL

This commit is contained in:
Sebastian Hädrich 2025-06-24 13:33:00 +02:00 committed by GitHub
parent 34739f2cce
commit f69352fe56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,6 +77,10 @@ export const HashtagMenuController: React.FC = () => {
return;
}
hashtagUrl = new URL('/filters', document.location)
hashtagUrl.searchParams.set('custom_filter[keywords_attributes][0][keyword]', target.text)
hashtagUrl.searchParams.set('custom_filter[keywords_attributes][0][whole_word]', 1)
e.preventDefault();
e.stopPropagation();
targetRef.current = target;
@ -116,7 +120,7 @@ export const HashtagMenuController: React.FC = () => {
text: intl.formatMessage(messages.muteHashtag, {
hashtag,
}),
href: `/filters?custom_filter[keywords_attributes][0][keyword]=%23${hashtag}&custom_filter[keywords_attributes][0][whole_word]=1`,
href: hashtagUrl.toString(),
dangerous: true,
},
],