Skip to content

Commit

Permalink
Ensure links to person detail page are encoded correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 committed Feb 9, 2025
1 parent f193f35 commit a527f25
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ <h4 class="title mb-2">
[allowToggle]="false"
(toggle)="switchTabsToDetail()">
<ng-template #badgeExpanderItem let-item let-position="idx" let-last="last">
<a routerLink="/person/{{item.name}}/" class="dark-exempt btn-icon">{{item.name}}</a>
<a routerLink="/person/{{encodeURIComponent(item.name)}}/" class="dark-exempt btn-icon">{{item.name}}</a>
</ng-template>
</app-badge-expander>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1173,4 +1173,6 @@ export class SeriesDetailComponent implements OnInit, AfterContentChecked {
}
}, 10);
}

protected readonly encodeURIComponent = encodeURIComponent;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@if (person !== undefined) {
<a class="btn btn-icon p-0" routerLink="/person/{{person.name}}">
<a class="btn btn-icon p-0" routerLink="/person/{{encodeURIComponent(person.name)}}">
<div class="tagbadge cursor clickable">
<div class="d-flex flex-column align-items-center justify-content-center">
<div class="image-container d-flex align-items-center justify-content-center">
@if (HasCoverImage) {
<app-image
objectFit="cover"
objectFit="cover"
height="96px"
width="96px"
[imageUrl]="ImageUrl"
Expand Down
2 changes: 2 additions & 0 deletions UI/Web/src/app/shared/person-badge/person-badge.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ export class PersonBadgeComponent implements OnInit {
this.staff = this.person as SeriesStaff;
this.cdRef.markForCheck();
}

protected readonly encodeURIComponent = encodeURIComponent;
}

0 comments on commit a527f25

Please sign in to comment.