Skip to content

Commit

Permalink
Add Neccesary parameter to resolveVulnAliases function
Browse files Browse the repository at this point in the history
common.resolveVulnALiases needs the vulnerability source and the aliases to deduplicate the list on the Aliases column,

In case before, the only parameter added to the function was "value" which do not include neither the source of the current
vulnerability or their aliases.

Thats why I am adding row.source and row.aliases to the function.

I discovered that the 'return' statement was located within the condition if(typeof value !== 'undefined'),
This created a problem because the function would not return anything for null values.
To fix this, I moved the 'return' outside of the condition.

Signed-off-by: Andres Tito <[email protected]>
  • Loading branch information
LaVibeX committed Mar 7, 2024
1 parent 1275703 commit bedd0f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/portfolio/vulnerabilities/VulnerabilityList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ import VulnerabilityCreateVulnerabilityModal from "./VulnerabilityCreateVulnerab
field: "aliases",
visible: false,
formatter(value, row, index) {
let label = "";
if (typeof value !== 'undefined') {
let label = "";
const aliases = common.resolveVulnAliases(value);
const aliases = common.resolveVulnAliases(row.source,row.aliases);
for (let i=0; i<aliases.length; i++) {
let alias = aliases[i];
let url = xssFilters.uriInUnQuotedAttr("../vulnerabilities/" + alias.source + "/" + alias.vulnId);
label += common.formatSourceLabel(alias.source) + ` <a href="${url}">${xssFilters.inHTMLData(alias.vulnId)}</a>`
if (i < aliases.length-1) label += "<br/><br/>"
}
return label;
}
return label;
}
},
{
Expand Down

0 comments on commit bedd0f0

Please sign in to comment.