1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

sanitize reflected user input on job details page

This makes sure we're applying the 'sanitize' filter to reflected user input for some of the new information we're displaying on the job details page.
This commit is contained in:
Jake McDermott 2019-01-29 09:35:57 -05:00 committed by GitHub
parent 8686575311
commit ca64630740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,13 +114,14 @@ function getVerbosityDetails () {
}
function getEnvironmentDetails (virtualenv) {
const value = virtualenv || resource.model.get('custom_virtualenv');
const customVirtualenv = virtualenv || resource.model.get('custom_virtualenv');
if (!value || value === '') {
if (!customVirtualenv || customVirtualenv === '') {
return null;
}
const label = strings.get('labels.ENVIRONMENT');
const value = $filter('sanitize')(customVirtualenv);
return { label, value };
}
@ -345,6 +346,7 @@ function getInventoryScmDetails (updateId, updateStatus) {
const link = `/#/projects/${projectId}`;
const jobTooltip = strings.get('tooltips.INVENTORY_SCM_JOB');
const tooltip = strings.get('tooltips.INVENTORY_SCM');
const value = $filter('sanitize')(projectName);
let icon;
@ -354,7 +356,7 @@ function getInventoryScmDetails (updateId, updateStatus) {
icon = `fa icon-job-${status}`;
}
return { label, link, icon, jobLink, jobTooltip, tooltip, value: projectName };
return { label, link, icon, jobLink, jobTooltip, tooltip, value };
}
function getSCMRevisionDetails () {