Code Duplication    Length = 28-36 lines in 2 locations

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

@@ 3426-3461 (lines=36) @@
3423
            return $this->mainPhase($token);
3424
3425
            /* An end tag whose tag name is "table" */
3426
        } elseif ($token['type'] === HTML5::ENDTAG &&
3427
            $token['name'] === 'table'
3428
        ) {
3429
            /* If the stack of open elements does not have an element in table
3430
            scope with the same tag name as the token, this is a parse error.
3431
            Ignore the token. (innerHTML case) */
3432
            if (!$this->elementInScope($token['name'], true)) {
3433
                return false;
3434
3435
                /* Otherwise: */
3436
            } else {
3437
                /* Generate implied end tags. */
3438
                $this->generateImpliedEndTags();
3439
3440
                /* Now, if the current node is not a table element, then this
3441
                is a parse error. */
3442
                // w/e
3443
3444
                /* Pop elements from this stack until a table element has been
3445
                popped from the stack. */
3446
                while (true) {
3447
                    $current = end($this->stack)->nodeName;
3448
                    array_pop($this->stack);
3449
3450
                    if ($current === 'table') {
3451
                        break;
3452
                    }
3453
                }
3454
3455
                /* Reset the insertion mode appropriately. */
3456
                $this->resetInsertionMode();
3457
            }
3458
3459
            /* An end tag whose tag name is one of: "body", "caption", "col",
3460
            "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */
3461
        } elseif ($token['type'] === HTML5::ENDTAG && in_array(
3462
                $token['name'],
3463
                array(
3464
                    'body',
@@ 4123-4150 (lines=28) @@
4120
            }
4121
4122
            /* An end tag whose tag name is "select" */
4123
        } elseif ($token['type'] === HTML5::ENDTAG &&
4124
            $token['name'] === 'select'
4125
        ) {
4126
            /* If the stack of open elements does not have an element in table
4127
            scope with the same tag name as the token, this is a parse error.
4128
            Ignore the token. (innerHTML case) */
4129
            if (!$this->elementInScope($token['name'], true)) {
4130
                // w/e
4131
4132
                /* Otherwise: */
4133
            } else {
4134
                /* Pop elements from the stack of open elements until a select
4135
                element has been popped from the stack. */
4136
                while (true) {
4137
                    $current = end($this->stack)->nodeName;
4138
                    array_pop($this->stack);
4139
4140
                    if ($current === 'select') {
4141
                        break;
4142
                    }
4143
                }
4144
4145
                /* Reset the insertion mode appropriately. */
4146
                $this->resetInsertionMode();
4147
            }
4148
4149
            /* A start tag whose tag name is "select" */
4150
        } elseif ($token['name'] === 'select' &&
4151
            $token['type'] === HTML5::STARTTAG
4152
        ) {
4153
            /* Parse error. Act as if the token had been an end tag with the