diff options
author | Chocobozzz <me@florianbigard.com> | 2022-11-14 14:21:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-11-14 14:21:40 +0100 |
commit | 2198bb5a1981177b04dd94b2b1b6a90c5d7a5c25 (patch) | |
tree | 668365a50351c573949e066c1be440683795e262 /client/src/app/shared/shared-forms | |
parent | b1934b7e9cdece7c0c38e05b0f905dc2ccab9167 (diff) | |
download | PeerTube-2198bb5a1981177b04dd94b2b1b6a90c5d7a5c25.tar.gz PeerTube-2198bb5a1981177b04dd94b2b1b6a90c5d7a5c25.tar.zst PeerTube-2198bb5a1981177b04dd94b2b1b6a90c5d7a5c25.zip |
Prevent XSS with ng-select
When using ng-option
See https://github.com/ng-select/ng-select/issues/1363
Diffstat (limited to 'client/src/app/shared/shared-forms')
-rw-r--r-- | client/src/app/shared/shared-forms/select/select-channel.component.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/src/app/shared/shared-forms/select/select-channel.component.ts b/client/src/app/shared/shared-forms/select/select-channel.component.ts index 5fcae0050..26d6216ef 100644 --- a/client/src/app/shared/shared-forms/select/select-channel.component.ts +++ b/client/src/app/shared/shared-forms/select/select-channel.component.ts | |||
@@ -39,8 +39,10 @@ export class SelectChannelComponent implements ControlValueAccessor, OnChanges { | |||
39 | 39 | ||
40 | propagateChange = (_: any) => { /* empty */ } | 40 | propagateChange = (_: any) => { /* empty */ } |
41 | 41 | ||
42 | writeValue (id: number) { | 42 | writeValue (id: number | string) { |
43 | this.selectedId = id | 43 | this.selectedId = typeof id === 'string' |
44 | ? parseInt(id, 10) | ||
45 | : id | ||
44 | } | 46 | } |
45 | 47 | ||
46 | registerOnChange (fn: (_: any) => void) { | 48 | registerOnChange (fn: (_: any) => void) { |