From: Alexander Ebert Date: Fri, 16 Oct 2020 23:28:23 +0000 (+0200) Subject: Incorrect access of map values X-Git-Tag: 5.4.0_Alpha_1~704^2~48 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e940c78767bfc0b338b274c457cb465c8d570b3;p=GitHub%2FWoltLab%2FWCF.git Incorrect access of map values --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Traverse.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Traverse.js index 1da77f0476..82e7a72887 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Traverse.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Traverse.js @@ -23,7 +23,7 @@ define(["require", "exports"], function (require, exports) { } const children = []; for (let i = 0; i < element.childElementCount; i++) { - if (_test[type](element.children[i], value)) { + if (_test.get(type)(element.children[i], value)) { children.push(element.children[i]); } } @@ -38,7 +38,7 @@ define(["require", "exports"], function (require, exports) { if (target === untilElement) { return null; } - if (_test[type](target, value)) { + if (_test.get(type)(target, value)) { return target; } target = target.parentNode; @@ -50,7 +50,7 @@ define(["require", "exports"], function (require, exports) { throw new TypeError('Expected a valid element as first argument.'); } if (element instanceof Element) { - if (element[siblingType] !== null && _test[type](element[siblingType], value)) { + if (element[siblingType] !== null && _test.get(type)(element[siblingType], value)) { return element[siblingType]; } } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Traverse.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Traverse.ts index d57cc855b7..4ae5e7cf7f 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Traverse.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Traverse.ts @@ -29,7 +29,7 @@ function _getChildren(element: Element, type: Type, value: string): Element[] { const children: Element[] = []; for (let i = 0; i < element.childElementCount; i++) { - if (_test[type](element.children[i], value)) { + if (_test.get(type)!(element.children[i], value)) { children.push(element.children[i]); } } @@ -48,7 +48,7 @@ function _getParent(element: Element, type: Type, value: string, untilElement?: return null; } - if (_test[type](target, value)) { + if (_test.get(type)!(target, value)) { return target; } @@ -64,7 +64,7 @@ function _getSibling(element: Element, siblingType: string, type: Type, value: s } if (element instanceof Element) { - if (element[siblingType] !== null && _test[type](element[siblingType], value)) { + if (element[siblingType] !== null && _test.get(type)!(element[siblingType], value)) { return element[siblingType]; } }