diff --git a/src/app/people/people.ts b/src/app/people/people.ts index ce35024..dcac89d 100644 --- a/src/app/people/people.ts +++ b/src/app/people/people.ts @@ -92,7 +92,7 @@ export class PeopleComponent { } async ngOnInit() { - this.appState.title = 'People'; + this.appState.updateTitle('People'); this.appState.showBackButton = false; this.appState.actions = [ { diff --git a/src/app/profile/profile.ts b/src/app/profile/profile.ts index f1f900e..7f3e54d 100644 --- a/src/app/profile/profile.ts +++ b/src/app/profile/profile.ts @@ -47,7 +47,7 @@ export class ProfileComponent { ) {} async ngOnInit() { - this.appState.title = 'Edit Profile'; + this.appState.updateTitle('Edit Profile'); this.originalProfile = { name: '', diff --git a/src/app/services/utilities.ts b/src/app/services/utilities.ts index 6371f62..e9289b8 100644 --- a/src/app/services/utilities.ts +++ b/src/app/services/utilities.ts @@ -144,13 +144,51 @@ export class Utilities { return secp.utils.bytesToHex(publicKey); } - sanitize(url: string) { + sanitizeLUD06(url?: string) { + // Do not allow http prefix. + if (!url && url?.startsWith('http')) { + return undefined; + } + + return url; + } + + sanitizeUrl(url?: string) { + if (!url && !url?.startsWith('http')) { + return ''; + } + + return url; + } + + sanitizeImageUrl(url?: string) { + url = this.sanitizeUrl(url); + + if (!url) { + return undefined; + } + + const urlLower = url.toLowerCase(); + + if (urlLower.endsWith('jpg') || urlLower.endsWith('jpeg') || urlLower.endsWith('png') || urlLower.endsWith('webp') || urlLower.endsWith('gif')) { + return url; + } + + return undefined; + } + + bypassUrl(url: string) { const clean = this.sanitizer.bypassSecurityTrustUrl(url); return clean; } - sanitizeUrl(url: string) { + bypassResourceUrl(url: string) { const clean = this.sanitizer.bypassSecurityTrustResourceUrl(url); return clean; } + + bypassStyle(url: string) { + const clean = this.sanitizer.bypassSecurityTrustStyle(url); + return clean; + } } diff --git a/src/app/shared/content/content.ts b/src/app/shared/content/content.ts index b1e8a38..829547e 100644 --- a/src/app/shared/content/content.ts +++ b/src/app/shared/content/content.ts @@ -75,7 +75,7 @@ export class ContentComponent { this.images = images.map((i) => this.utilities.sanitizeUrl(i[0])); const thisisthewayMatch = [...content.matchAll(ContentComponent.regexpThisIsTheWay)]; - const thisistheway = thisisthewayMatch.map((i) => this.utilities.sanitizeUrl(`https://i.ytimg.com/vi/LaiN63o_BxA/maxresdefault.jpg`)); + const thisistheway = thisisthewayMatch.map((i) => this.utilities.bypassResourceUrl(`https://i.ytimg.com/vi/LaiN63o_BxA/maxresdefault.jpg`)); this.images.push(...thisistheway); const videos = [...content.matchAll(ContentComponent.regexpVideo)]; diff --git a/src/app/shared/profile-header/profile-header.css b/src/app/shared/profile-header/profile-header.css index 5033219..1a171a1 100644 --- a/src/app/shared/profile-header/profile-header.css +++ b/src/app/shared/profile-header/profile-header.css @@ -81,3 +81,13 @@ width: 100%; height: 100%; } + +.profile-banner { + background-repeat: no-repeat; + background-position: center; + background-size: cover; + min-height: 240px; + /* margin-bottom: 30em; + position: fixed; */ + width: 100%; +} diff --git a/src/app/shared/profile-header/profile-header.html b/src/app/shared/profile-header/profile-header.html index ed4f4b6..21f6af3 100644 --- a/src/app/shared/profile-header/profile-header.html +++ b/src/app/shared/profile-header/profile-header.html @@ -1,24 +1,24 @@ -