Angular 2 disable sanitize

You need to explicitly tell Angular2 that the string is trusted https://angular.io/docs/ts/latest/api/platform-browser/index/DomSanitizer-class.html constructor(private sanitizer:DomSanitizer) {} get imgBase64() { this.sanitizer.bypassSecurityTrustUrl(‘data:image/png;base64,$SomeBase64StringFetchedSomehow’); } <img alt=”RegularImage” [src]=”imgBase64″> See also In RC.1 some styles can’t be added using binding syntax

Sanitizing HTML input

You will have to decide between good and lightweight. The recommended choice is ‘HTMLPurifier’, because it provide no-fuss secure defaults. As faster alternative it is often advised to use ‘htmLawed‘. See also this quite objective overview from the HTMLPurifier author: http://htmlpurifier.org/comparison

Sanitize table/column name in Dynamic SQL in .NET? (Prevent SQL injection attacks)

I’m not sure if you’re still looking into this, but the DbCommandBuilder class provides a method QuoteIdentifier for this purpose. The main benefits of this are that it’s database-independent and doesn’t involve any RegEx mess. As of .NET 4.5, you have everything you need to sanitize table and column names just using your DbConnection object: … Read more