Skip to content

Commit

Permalink
Merge pull request #351 from GOKULRAJ136/MOSIP-36172
Browse files Browse the repository at this point in the history
Security hotspot fix [MOSIP-37914]
  • Loading branch information
aranaravi authored Jan 9, 2025
2 parents 3929305 + 60937e7 commit ea8fa6c
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Sanitizer, SecurityContext } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { AppConfigService } from 'src/app/app-config.service';
import { AuditService } from 'src/app/core/services/audit.service';
import { DataStorageService } from 'src/app/core/services/data-storage.service';
import { MatDialog } from '@angular/material/dialog';
import { DialogComponent } from 'src/app/shared/dialog/dialog.component';
import { DomSanitizer } from '@angular/platform-browser';
import { saveAs } from 'file-saver';
import { ActivatedRoute, Router, NavigationEnd } from '@angular/router';
import { HttpErrorResponse } from '@angular/common/http';
Expand Down Expand Up @@ -38,7 +37,7 @@ export class DownloadCardComponent implements OnInit {
private activatedRoute: ActivatedRoute,
private dataStorageService: DataStorageService,
public dialog: MatDialog,
private sanitizer:DomSanitizer,
private sanitizer: Sanitizer,
private router: Router
) {
translate.use(appService.getConfig().primaryLangCode);
Expand Down Expand Up @@ -81,8 +80,7 @@ export class DownloadCardComponent implements OnInit {
}

renderImage(){
const trustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.data.applicantPhoto);
this.applicantPhoto = trustedUrl;
this.applicantPhoto = this.sanitizer.sanitize(SecurityContext.URL, this.data.applicantPhoto);
}

search() {
Expand Down

0 comments on commit ea8fa6c

Please sign in to comment.