From: Tiago Melo Date: Wed, 13 Feb 2019 15:36:47 +0000 (+0000) Subject: mgr/dashboard: Replace encodeURI for encodeURIComponent X-Git-Tag: v14.1.0~49^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8acf2952abb7a245e696b71a51cf13334409da79;p=ceph.git mgr/dashboard: Replace encodeURI for encodeURIComponent Fixes: http://tracker.ceph.com/issues/38303 Signed-off-by: Tiago Melo --- 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 97051ca5cea5..335798f9c3d8 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 e186195c5c71..b1fd47fa13e4 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 f7b7787a29bc..f504d5448532 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',