Merge commit from fork
* Check scheme in account and post links * Harden media attachments * Client-side mitigation * Client-side mitigation for media attachments
This commit is contained in:
		@@ -77,6 +77,17 @@ export function normalizeStatus(status, normalOldStatus) {
 | 
			
		||||
    normalStatus.contentHtml  = emojify(normalStatus.content, emojiMap);
 | 
			
		||||
    normalStatus.spoilerHtml  = emojify(escapeTextContentForBrowser(spoilerText), emojiMap);
 | 
			
		||||
    normalStatus.hidden       = expandSpoilers ? false : spoilerText.length > 0 || normalStatus.sensitive;
 | 
			
		||||
 | 
			
		||||
    if (normalStatus.url && !(normalStatus.url.startsWith('http://') || normalStatus.url.startsWith('https://'))) {
 | 
			
		||||
      normalStatus.url = null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    normalStatus.url ||= normalStatus.uri;
 | 
			
		||||
 | 
			
		||||
    normalStatus.media_attachments.forEach(item => {
 | 
			
		||||
      if (item.remote_url && !(item.remote_url.startsWith('http://') || item.remote_url.startsWith('https://')))
 | 
			
		||||
        item.remote_url = null;
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (normalOldStatus) {
 | 
			
		||||
 
 | 
			
		||||
@@ -144,5 +144,6 @@ export function createAccountFromServerJSON(serverJSON: ApiAccountJSON) {
 | 
			
		||||
    ),
 | 
			
		||||
    note_emojified: emojify(accountJSON.note, emojiMap),
 | 
			
		||||
    note_plain: unescapeHTML(accountJSON.note),
 | 
			
		||||
    url: accountJSON.url.startsWith('http://') || accountJSON.url.startsWith('https://') ? accountJSON.url : accountJSON.uri,
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user