Code Duplication    Length = 21-26 lines in 2 locations

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

@@ 3843-3868 (lines=26) @@
3840
            return $this->inCell($token);
3841
3842
            /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */
3843
        } elseif ($token['type'] === HTML5::ENDTAG &&
3844
            in_array($token['name'], array('tbody', 'tfoot', 'thead'))
3845
        ) {
3846
            /* If the stack of open elements does not have an element in table
3847
            scope with the same tag name as the token, this is a parse error.
3848
            Ignore the token. */
3849
            if (!$this->elementInScope($token['name'], true)) {
3850
                // Ignore.
3851
3852
                /* Otherwise: */
3853
            } else {
3854
                /* Otherwise, act as if an end tag with the tag name "tr" had
3855
                been seen, then reprocess the current token. */
3856
                $this->inRow(
3857
                    array(
3858
                        'name' => 'tr',
3859
                        'type' => HTML5::ENDTAG
3860
                    )
3861
                );
3862
3863
                return $this->inCell($token);
3864
            }
3865
3866
            /* An end tag whose tag name is one of: "body", "caption", "col",
3867
            "colgroup", "html", "td", "th" */
3868
        } elseif ($token['type'] === HTML5::ENDTAG && in_array(
3869
                $token['name'],
3870
                array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr')
3871
            )
@@ 3995-4015 (lines=21) @@
3992
3993
            /* An end tag whose tag name is one of: "table", "tbody", "tfoot",
3994
            "thead", "tr" */
3995
        } elseif ($token['type'] === HTML5::ENDTAG && in_array(
3996
                $token['name'],
3997
                array('table', 'tbody', 'tfoot', 'thead', 'tr')
3998
            )
3999
        ) {
4000
            /* If the stack of open elements does not have an element in table
4001
            scope with the same tag name as that of the token (which can only
4002
            happen for "tbody", "tfoot" and "thead", or, in the innerHTML case),
4003
            then this is a parse error and the token must be ignored. */
4004
            if (!$this->elementInScope($token['name'], true)) {
4005
                // Ignore.
4006
4007
                /* Otherwise, close the cell (see below) and reprocess the current
4008
                token. */
4009
            } else {
4010
                $this->closeCell();
4011
                return $this->inRow($token);
4012
            }
4013
4014
            /* Anything else */
4015
        } else {
4016
            /* Process the token as if the insertion mode was "in body". */
4017
            $this->inBody($token);
4018
        }