mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
@ -52,11 +52,11 @@ export const sanitizeDOMString = (untrustedString: string | undefined): string |
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// IE does not support .children on document fragments, only .childNodes
|
// IE does not support .children on document fragments, only .childNodes
|
||||||
const documentFragmentChildren = getElementChildren(documentFragment);
|
const dfChildren = getElementChildren(documentFragment);
|
||||||
|
|
||||||
/* tslint:disable-next-line */
|
/* tslint:disable-next-line */
|
||||||
for (let childIndex = 0; childIndex < documentFragmentChildren.length; childIndex++) {
|
for (let childIndex = 0; childIndex < dfChildren.length; childIndex++) {
|
||||||
sanitizeElement(documentFragmentChildren[childIndex]);
|
sanitizeElement(dfChildren[childIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append document fragment to div
|
// Append document fragment to div
|
||||||
@ -118,8 +118,8 @@ const sanitizeElement = (element: any) => {
|
|||||||
* IE doesn't always support .children
|
* IE doesn't always support .children
|
||||||
* so we revert to .childNodes instead
|
* so we revert to .childNodes instead
|
||||||
*/
|
*/
|
||||||
const getElementChildren = (element: any) => {
|
const getElementChildren = (el: any) => {
|
||||||
return (element.children != null) ? element.children : element.childNodes;
|
return (el.children != null) ? el.children : el.childNodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
const allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];
|
const allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];
|
||||||
|
Reference in New Issue
Block a user