Security fixes
Co-Authored-By: dakkar <dakkar@thenautilus.net>
This commit is contained in:
parent
9e13c375c5
commit
0bb4e57b0c
14 changed files with 56 additions and 26 deletions
|
|
@ -496,9 +496,7 @@ export class ApRendererService {
|
|||
const attachment = profile.fields.map(field => ({
|
||||
type: 'PropertyValue',
|
||||
name: field.name,
|
||||
value: (field.value.startsWith('http://') || field.value.startsWith('https://'))
|
||||
? `<a href="${new URL(field.value).href}" rel="me nofollow noopener" target="_blank">${new URL(field.value).href}</a>`
|
||||
: field.value,
|
||||
value: this.mfmService.toHtml(mfm.parse(field.value)),
|
||||
}));
|
||||
|
||||
const emojis = await this.getEmojis(user.emojis);
|
||||
|
|
|
|||
|
|
@ -52,12 +52,10 @@ export class UrlPreviewService {
|
|||
@bindThis
|
||||
private wrap(url?: string | null): string | null {
|
||||
return url != null
|
||||
? url.match(/^https?:\/\//)
|
||||
? `${this.config.mediaProxy}/preview.webp?${query({
|
||||
url,
|
||||
preview: '1',
|
||||
})}`
|
||||
: url
|
||||
? `${this.config.mediaProxy}/preview.webp?${query({
|
||||
url,
|
||||
preview: '1',
|
||||
})}`
|
||||
: null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue