misc: encode uri components for post fetching

This commit is contained in:
James Xylight committed 2025-02-09 11:09:52 -08:00
1 parent 8932d00978
commit a94dd5f3d4
6 files changed
+15 -9

No files matched your search

+2 -2
View File
@@ -86,10 +86,10 @@
{#if profile.data.user}
{#if !data.community.discussion_languages.every( (l) => profile.data.user?.discussion_languages.includes(l), ) && profile.data.user.discussion_languages.length > 0}
<Note class="!p-1 !pl-3">
<Note class="!p-1 !pl-3 flex-col md:flex-row">
{$t('routes.community.languageWarning')}
<Button
class="inline-block self-end ml-auto"
class="inline-block md:ml-auto"
href="/profile/settings"
color="tertiary"
rounding="pill"
+4 -1
View File
@@ -4,5 +4,8 @@ import { get } from 'svelte/store'
export function load({ params }) {
// If you somehow got to /comment/instance, it likely means you passed in an ID, not an instance.
redirect(302, `/comment/${profile.data.instance}/${params.instance}`)
redirect(
302,
`/comment/${encodeURIComponent(profile.data.instance)}/${params.instance}`,
)
}
+5 -1
View File
@@ -6,7 +6,11 @@ export function load({ params, url }) {
if (Number(params.instance)) {
const split = url.pathname.split('/')
split.splice(2, 0, `${profile.data.instance?.toLowerCase()}`)
split.splice(
2,
0,
`${encodeURIComponent(profile.data.instance)?.toLowerCase()}`,
)
const newUrl = new URL(url)
newUrl.pathname = split.join('/')