misc: encode uri components for post fetching
This commit is contained in:
6 files changed
+15
-9
No files matched your search
@@ -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,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}`,
|
||||
)
|
||||
}
|
||||
@@ -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('/')
|
||||
|
||||
Reference in new issue
Block a user