Skip to content

Commit

Permalink
Merge pull request #770 from makkaq/master
Browse files Browse the repository at this point in the history
Sanitize attributes with jQuery when replacing img element
  • Loading branch information
dimsemenov committed Feb 20, 2016
2 parents 1781908 + 389a16a commit b083e52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ MagnificPopup.prototype = {
if(el.is('img')) {
el.attr('src', value);
} else {
el.replaceWith( '<img src="'+value+'" class="' + el.attr('class') + '" />' );
el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
}
} else {
el.attr(arr[1], value);
Expand Down

0 comments on commit b083e52

Please sign in to comment.