From f42c9bb952e6d75f5e95a2ef87254897468df228 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Tue, 22 May 2018 17:45:51 -0400 Subject: [PATCH] sanitize dynamic breadcrumb label --- awx/ui/client/features/output/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/features/output/index.js b/awx/ui/client/features/output/index.js index be7bf49b33..e26112915b 100644 --- a/awx/ui/client/features/output/index.js +++ b/awx/ui/client/features/output/index.js @@ -186,9 +186,10 @@ function getWebSocketResource (type) { return { name, key }; } -function JobsRun ($stateRegistry, strings) { +function JobsRun ($stateRegistry, $filter, strings) { const parent = 'jobs'; const ncyBreadcrumb = { parent, label: strings.get('state.BREADCRUMB_DEFAULT') }; + const sanitize = $filter('sanitize'); const state = { url: '/:type/:id?job_event_search', @@ -231,7 +232,7 @@ function JobsRun ($stateRegistry, strings) { breadcrumbLabel: [ 'resource', ({ model }) => { - ncyBreadcrumb.label = `${model.get('id')} - ${model.get('name')}`; + ncyBreadcrumb.label = `${model.get('id')} - ${sanitize(model.get('name'))}`; } ], }, @@ -240,7 +241,7 @@ function JobsRun ($stateRegistry, strings) { $stateRegistry.register(state); } -JobsRun.$inject = ['$stateRegistry', 'JobStrings']; +JobsRun.$inject = ['$stateRegistry', '$filter', 'JobStrings']; angular .module(MODULE_NAME, [