Skip to content

Commit

Permalink
Run img element creation through jQuery to ensure attributes are sani…
Browse files Browse the repository at this point in the history
…tised correctly
  • Loading branch information
makkaq committed Nov 17, 2015
1 parent e27a27c commit 389a16a
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 @@ -780,7 +780,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 389a16a

Please sign in to comment.