Fixed potential infinite loop
authorAlexander Ebert <ebert@woltlab.com>
Mon, 6 Apr 2015 00:00:41 +0000 (02:00 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 6 Apr 2015 00:00:41 +0000 (02:00 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js

index 302b302d190c7aff276868e785a7784d77461b20..10e76ca683a739004c0f92cc7e6b1e2019125c04 100644 (file)
@@ -837,13 +837,12 @@ RedactorPlugins.wutil = function() {
                 * @return      boolean
                 */
                isNodeWithin: function(node, element) {
-                       var $node = $(node);
-                       while ($node[0] !== this.$editor[0]) {
-                               if ($node[0] === element) {
+                       while (node && node !== this.$editor[0]) {
+                               if (node === element) {
                                        return true;
                                }
                                
-                               $node = $node.parent();
+                               node = node.parentNode;
                        }
                        
                        return false;