66
66
<span v-for =" alias in resolveVulnAliases(vulnerability.aliases)" >
67
67
<b-link
68
68
style =" margin-right : 1rem "
69
- :href =" `/vulnerabilities/${alias.source}/${alias.vulnId}`"
69
+ :href =" `/vulnerabilities/${alias.source}/${encodeURIComponent( alias.vulnId) }`"
70
70
>{{ alias.vulnId }}</b-link
71
71
>
72
72
</span >
@@ -446,7 +446,7 @@ export default {
446
446
if (this .uuid ) {
447
447
url = ` ${ this .$api .BASE_URL } /${ this .$api .URL_VULNERABILITY } /${ this .uuid } ` ;
448
448
} else {
449
- url = ` ${ this .$api .BASE_URL } /${ this .$api .URL_VULNERABILITY } /source/${ this .source } /vuln/${ this .vulnId } ` ;
449
+ url = ` ${ this .$api .BASE_URL } /${ this .$api .URL_VULNERABILITY } /source/${ this .source } /vuln/${ encodeURIComponent ( this .vulnId ) } ` ;
450
450
}
451
451
this .axios .get (url).then ((response ) => {
452
452
this .vulnerability = response .data ;
@@ -467,7 +467,7 @@ export default {
467
467
initializeData : function () {
468
468
this .uuid = this .$route .params .uuid ;
469
469
this .source = this .$route .params .source ;
470
- this .vulnId = this .$route .params .vulnId ;
470
+ this .vulnId = decodeURIComponent ( this .$route .params .vulnId ) ;
471
471
},
472
472
routeTo (path ) {
473
473
if (path) {
@@ -479,19 +479,31 @@ export default {
479
479
' /vulnerabilities/' +
480
480
this .source +
481
481
' /' +
482
- this .vulnId +
482
+ encodeURIComponent ( this .vulnId ) +
483
483
' /' +
484
484
path,
485
485
});
486
486
}
487
487
} else if (
488
488
this .$route .fullPath !==
489
- ' /vulnerabilities/' + this .source + ' /' + this .vulnId &&
489
+ ' /vulnerabilities/' +
490
+ this .source +
491
+ ' /' +
492
+ encodeURIComponent (this .vulnId ) &&
490
493
this .$route .fullPath !==
491
- ' /vulnerabilities/' + this .source + ' /' + this .vulnId + ' /'
494
+ ' /vulnerabilities/' +
495
+ this .source +
496
+ ' /' +
497
+ encodeURIComponent (this .vulnId ) +
498
+ ' /'
492
499
) {
493
500
this .$router .push ({
494
- path: ' /vulnerabilities/' + this .source + ' /' + this .vulnId + ' /' ,
501
+ path:
502
+ ' /vulnerabilities/' +
503
+ this .source +
504
+ ' /' +
505
+ encodeURIComponent (this .vulnId ) +
506
+ ' /' ,
495
507
});
496
508
}
497
509
},
@@ -500,7 +512,7 @@ export default {
500
512
' /vulnerabilities\\ /' +
501
513
this .source +
502
514
' \\ /' +
503
- this .vulnId +
515
+ encodeURIComponent ( this .vulnId ) +
504
516
' \\ /([^\\ /]*)' ,
505
517
' gi' ,
506
518
);
@@ -533,7 +545,12 @@ export default {
533
545
} catch (e) {
534
546
this .$toastr .e (this .$t (' condition.forbidden' ));
535
547
this .$router .replace ({
536
- path: ' /vulnerabilities/' + this .source + ' /' + this .vulnId + ' /' ,
548
+ path:
549
+ ' /vulnerabilities/' +
550
+ this .source +
551
+ ' /' +
552
+ encodeURIComponent (this .vulnId ) +
553
+ ' /' ,
537
554
});
538
555
this .$refs .overview .active = true ;
539
556
}
0 commit comments