Code Duplication    Length = 31-34 lines in 2 locations

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

@@ 3939-3969 (lines=31) @@
3936
3937
            /* A start tag whose tag name is one of: "caption", "col", "colgroup",
3938
            "tbody", "td", "tfoot", "th", "thead", "tr" */
3939
        } elseif ($token['type'] === HTML5::STARTTAG && in_array(
3940
                $token['name'],
3941
                array(
3942
                    'caption',
3943
                    'col',
3944
                    'colgroup',
3945
                    'tbody',
3946
                    'td',
3947
                    'tfoot',
3948
                    'th',
3949
                    'thead',
3950
                    'tr'
3951
                )
3952
            )
3953
        ) {
3954
            /* If the stack of open elements does not have a td or th element
3955
            in table scope, then this is a parse error; ignore the token.
3956
            (innerHTML case) */
3957
            if (!$this->elementInScope(array('td', 'th'), true)) {
3958
                // Ignore.
3959
3960
                /* Otherwise, close the cell (see below) and reprocess the current
3961
                token. */
3962
            } else {
3963
                $this->closeCell();
3964
                return $this->inRow($token);
3965
            }
3966
3967
            /* A start tag whose tag name is one of: "caption", "col", "colgroup",
3968
            "tbody", "td", "tfoot", "th", "thead", "tr" */
3969
        } elseif ($token['type'] === HTML5::STARTTAG && in_array(
3970
                $token['name'],
3971
                array(
3972
                    'caption',
@@ 4178-4211 (lines=34) @@
4175
4176
            /* An end tag whose tag name is one of: "caption", "table", "tbody",
4177
            "tfoot", "thead", "tr", "td", "th" */
4178
        } elseif (in_array(
4179
                $token['name'],
4180
                array(
4181
                    'caption',
4182
                    'table',
4183
                    'tbody',
4184
                    'tfoot',
4185
                    'thead',
4186
                    'tr',
4187
                    'td',
4188
                    'th'
4189
                )
4190
            ) && $token['type'] === HTML5::ENDTAG
4191
        ) {
4192
            /* Parse error. */
4193
            // w/e
4194
4195
            /* If the stack of open elements has an element in table scope with
4196
            the same tag name as that of the token, then act as if an end tag
4197
            with the tag name "select" had been seen, and reprocess the token.
4198
            Otherwise, ignore the token. */
4199
            if ($this->elementInScope($token['name'], true)) {
4200
                $this->inSelect(
4201
                    array(
4202
                        'name' => 'select',
4203
                        'type' => HTML5::ENDTAG
4204
                    )
4205
                );
4206
4207
                $this->mainPhase($token);
4208
            }
4209
4210
            /* Anything else */
4211
        } else {
4212
            /* Parse error. Ignore the token. */
4213
        }
4214
    }