Skip to content

Commit ea9a61f

Browse files
Merge pull request #75 from nteske/encodingFix
URL Encoding Fix
2 parents c0808cb + ac9bac3 commit ea9a61f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

widget/assets/js/angular-lazy-img.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ angular.module('angularLazyImg').factory('LazyImgMagic', [
9797
if ($elem[0].nodeName.toLowerCase() === 'img') {
9898
$elem[0].src = src;
9999
} else {
100+
src=src.replace('"',"%22").replace("'","%27").replace("(","%28").replace(")","%29");
100101
$elem.css('background-image', 'url("' + src + '")');
101102
}
102103
}

widget/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295
height: $rootScope.deviceHeight
296296
}, function (err, imgUrl) {
297297
if (imgUrl) {
298-
img = imgUrl;
298+
img = imgUrl.replace('"',"%22").replace("'","%27").replace("(","%28").replace(")","%29");
299299
element.attr("style", 'background:url(' + img + ') !important ; background-size: cover !important;');
300300
} else {
301301
img = '';

0 commit comments

Comments
 (0)