Skip to content

Commit

Permalink
Fix potential xss on get width/height #1184
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauriC committed Feb 27, 2024
1 parent 941c8c5 commit 1249057
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tarteaucitron.js
Original file line number Diff line number Diff line change
Expand Up @@ -2248,10 +2248,10 @@ var tarteaucitron = {
return source;
},
"getElemWidth": function(elem) {
return elem.getAttribute('width') || elem.clientWidth;
return tarteaucitron.getElemAttr(elem, 'width') || elem.clientWidth;
},
"getElemHeight": function(elem) {
return elem.getAttribute('height') || elem.clientHeight;
return tarteaucitron.getElemAttr(elem, 'height') || elem.clientHeight;
},
"getElemAttr": function (elem, attr) {
var attribute = elem.getAttribute('data-' + attr) || elem.getAttribute(attr);
Expand Down
2 changes: 1 addition & 1 deletion tarteaucitron.min.js

Large diffs are not rendered by default.

0 comments on commit 1249057

Please sign in to comment.