Filter the attr to avoid possible XSS vulnerability Fix #1132
This commit is contained in:
parent
2565f0e2ba
commit
c4c2fcf2b2
|
|
@ -2083,7 +2083,13 @@ var tarteaucitron = {
|
||||||
return elem.getAttribute('height') || elem.clientHeight;
|
return elem.getAttribute('height') || elem.clientHeight;
|
||||||
},
|
},
|
||||||
"getElemAttr": function (elem, attr) {
|
"getElemAttr": function (elem, attr) {
|
||||||
return elem.getAttribute('data-' + attr) || elem.getAttribute(attr);
|
var attribute = elem.getAttribute('data-' + attr) || elem.getAttribute(attr);
|
||||||
|
|
||||||
|
if (typeof attribute === 'string') {
|
||||||
|
return tarteaucitron.fixSelfXSS(attribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
},
|
},
|
||||||
"addClickEventToId": function (elemId, func) {
|
"addClickEventToId": function (elemId, func) {
|
||||||
tarteaucitron.addClickEventToElement(document.getElementById(elemId), func);
|
tarteaucitron.addClickEventToElement(document.getElementById(elemId), func);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue