Code Duplication    Length = 31-34 lines in 2 locations

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

@@ 3926-3956 (lines=31) @@
3923
3924
            /* A start tag whose tag name is one of: "caption", "col", "colgroup",
3925
            "tbody", "td", "tfoot", "th", "thead", "tr" */
3926
        } elseif ($token['type'] === HTML5::STARTTAG && in_array(
3927
                $token['name'],
3928
                array(
3929
                    'caption',
3930
                    'col',
3931
                    'colgroup',
3932
                    'tbody',
3933
                    'td',
3934
                    'tfoot',
3935
                    'th',
3936
                    'thead',
3937
                    'tr'
3938
                )
3939
            )
3940
        ) {
3941
            /* If the stack of open elements does not have a td or th element
3942
            in table scope, then this is a parse error; ignore the token.
3943
            (innerHTML case) */
3944
            if (!$this->elementInScope(array('td', 'th'), true)) {
3945
                // Ignore.
3946
3947
                /* Otherwise, close the cell (see below) and reprocess the current
3948
                token. */
3949
            } else {
3950
                $this->closeCell();
3951
                return $this->inRow($token);
3952
            }
3953
3954
            /* A start tag whose tag name is one of: "caption", "col", "colgroup",
3955
            "tbody", "td", "tfoot", "th", "thead", "tr" */
3956
        } elseif ($token['type'] === HTML5::STARTTAG && in_array(
3957
                $token['name'],
3958
                array(
3959
                    'caption',
@@ 4164-4197 (lines=34) @@
4161
4162
            /* An end tag whose tag name is one of: "caption", "table", "tbody",
4163
            "tfoot", "thead", "tr", "td", "th" */
4164
        } elseif (in_array(
4165
                $token['name'],
4166
                array(
4167
                    'caption',
4168
                    'table',
4169
                    'tbody',
4170
                    'tfoot',
4171
                    'thead',
4172
                    'tr',
4173
                    'td',
4174
                    'th'
4175
                )
4176
            ) && $token['type'] === HTML5::ENDTAG
4177
        ) {
4178
            /* Parse error. */
4179
            // w/e
4180
4181
            /* If the stack of open elements has an element in table scope with
4182
            the same tag name as that of the token, then act as if an end tag
4183
            with the tag name "select" had been seen, and reprocess the token.
4184
            Otherwise, ignore the token. */
4185
            if ($this->elementInScope($token['name'], true)) {
4186
                $this->inSelect(
4187
                    array(
4188
                        'name' => 'select',
4189
                        'type' => HTML5::ENDTAG
4190
                    )
4191
                );
4192
4193
                $this->mainPhase($token);
4194
            }
4195
4196
            /* Anything else */
4197
        } else {
4198
            /* Parse error. Ignore the token. */
4199
        }
4200
    }