angularjs-imageupload-directive icon indicating copy to clipboard operation
angularjs-imageupload-directive copied to clipboard

Unsafe prefix for blob links

Open mankindsoftware opened this issue 12 years ago • 4 comments

Came upon an "unsafe" blob prefix that resulted in a broken image for {{image.url}}. However, {{image.dataURL}} worked nicely in it's place.

The cause and work-around is documented in https://github.com/angular/angular.js/issues/3889.

My environment:

  • Angular version 1.2.0-rc.2
  • Chrome Version 29.0.1547.76 m

The following was the recommended fix in this case and it works for me:

myModule.config(['$compileProvider', function($compileProvider) {
    var oldWhiteList = $compileProvider.imgSrcSanitizationWhitelist();
    $compileProvider.imgSrcSanitizationWhitelist(/^\s (https|ftp|file|blob):|data:image\//);
});

mankindsoftware avatar Oct 01 '13 04:10 mankindsoftware

Thanks for sharing!

johannesjo avatar Dec 12 '13 19:12 johannesjo

+1

sloops77 avatar Jan 20 '14 14:01 sloops77

It's a pull request https://github.com/angular/angular.js/pull/4623

ricricucit avatar Mar 08 '14 17:03 ricricucit

+1

ZhangBohan avatar Apr 03 '14 09:04 ZhangBohan