From 8acf2952abb7a245e696b71a51cf13334409da79 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Wed, 13 Feb 2019 15:36:47 +0000 Subject: [PATCH] mgr/dashboard: Replace encodeURI for encodeURIComponent Fixes: http://tracker.ceph.com/issues/38303 Signed-off-by: Tiago Melo --- .../src/app/ceph/block/rbd-list/rbd-list.component.ts | 4 +++- .../block/rbd-snapshot-list/rbd-snapshot-list.component.ts | 6 +++--- .../ceph/cluster/configuration/configuration.component.ts | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts index 97051ca5cea52..335798f9c3d82 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts @@ -82,7 +82,9 @@ export class RbdListComponent implements OnInit { this.permission = this.authStorageService.getPermissions().rbdImage; const getImageUri = () => this.selection.first() && - `${encodeURI(this.selection.first().pool_name)}/${encodeURI(this.selection.first().name)}`; + `${encodeURIComponent(this.selection.first().pool_name)}/${encodeURIComponent( + this.selection.first().name + )}`; const addAction: CdTableAction = { permission: 'create', icon: 'fa-plus', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts index e186195c5c71f..b1fd47fa13e42 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts @@ -84,9 +84,9 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges { actions.unprotect.click = () => this.toggleProtection(); const getImageUri = () => this.selection.first() && - `${encodeURI(this.poolName)}/${encodeURI(this.rbdName)}/${encodeURI( - this.selection.first().name - )}`; + `${encodeURIComponent(this.poolName)}/${encodeURIComponent( + this.rbdName + )}/${encodeURIComponent(this.selection.first().name)}`; actions.clone.routerLink = () => `/block/rbd/clone/${getImageUri()}`; actions.copy.routerLink = () => `/block/rbd/copy/${getImageUri()}`; actions.rollback.click = () => this.rollbackModal(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts index f7b7787a29bc4..f504d54485321 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts @@ -87,7 +87,7 @@ export class ConfigurationComponent implements OnInit { ) { this.permission = this.authStorageService.getPermissions().configOpt; const getConfigOptUri = () => - this.selection.first() && `${encodeURI(this.selection.first().name)}`; + this.selection.first() && `${encodeURIComponent(this.selection.first().name)}`; const editAction: CdTableAction = { permission: 'update', icon: 'fa-pencil', -- 2.39.5