Code Duplication    Length = 16-22 lines in 3 locations

htdocs/xoops_lib/modules/protector/library/HTMLPurifier/Lexer/PH5P.php 3 locations

@@ 2071-2086 (lines=16) @@
2068
            }
2069
2070
            /* An end tag with the tag name "head" */
2071
        } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') {
2072
            /* If the current node is a head element, pop the current node off
2073
            the stack of open elements. */
2074
            if ($this->head_pointer->isSameNode(end($this->stack))) {
2075
                array_pop($this->stack);
2076
2077
                /* Otherwise, this is a parse error. */
2078
            } else {
2079
                // k
2080
            }
2081
2082
            /* Change the insertion mode to "after head". */
2083
            $this->mode = self::AFTER_HEAD;
2084
2085
            /* A start tag with the tag name "head" or an end tag except "html". */
2086
        } elseif (($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') ||
2087
            ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html')
2088
        ) {
2089
            // Parse error. Ignore the token.
@@ 3650-3667 (lines=18) @@
3647
            array_pop($this->stack);
3648
3649
            /* An end tag whose tag name is "colgroup" */
3650
        } elseif ($token['type'] === HTML5::ENDTAG &&
3651
            $token['name'] === 'colgroup'
3652
        ) {
3653
            /* If the current node is the root html element, then this is a
3654
            parse error, ignore the token. (innerHTML case) */
3655
            if (end($this->stack)->nodeName === 'html') {
3656
                // Ignore
3657
3658
                /* Otherwise, pop the current node (which will be a colgroup
3659
                element) from the stack of open elements. Switch the insertion
3660
                mode to "in table". */
3661
            } else {
3662
                array_pop($this->stack);
3663
                $this->mode = self::IN_TABLE;
3664
            }
3665
3666
            /* An end tag whose tag name is "col" */
3667
        } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') {
3668
            /* Parse error. Ignore the token. */
3669
3670
            /* Anything else */
@@ 4269-4290 (lines=22) @@
4266
            $this->insertElement($token);
4267
4268
            /* An end tag with the tag name "frameset" */
4269
        } elseif ($token['name'] === 'frameset' &&
4270
            $token['type'] === HTML5::ENDTAG
4271
        ) {
4272
            /* If the current node is the root html element, then this is a
4273
            parse error; ignore the token. (innerHTML case) */
4274
            if (end($this->stack)->nodeName === 'html') {
4275
                // Ignore
4276
4277
            } else {
4278
                /* Otherwise, pop the current node from the stack of open
4279
                elements. */
4280
                array_pop($this->stack);
4281
4282
                /* If the parser was not originally created in order to handle
4283
                the setting of an element's innerHTML attribute (innerHTML case),
4284
                and the current node is no longer a frameset element, then change
4285
                the insertion mode to "after frameset". */
4286
                $this->mode = self::AFTR_FRAME;
4287
            }
4288
4289
            /* A start tag with the tag name "frame" */
4290
        } elseif ($token['name'] === 'frame' &&
4291
            $token['type'] === HTML5::STARTTAG
4292
        ) {
4293
            /* Insert an HTML element for the token. */