Code Duplication    Length = 9-14 lines in 2 locations

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

@@ 1775-1783 (lines=9) @@
1772
            /* A character token that is one of one of U+0009 CHARACTER TABULATION,
1773
            U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
1774
            or U+0020 SPACE */
1775
        } elseif (isset($token['data']) && preg_match(
1776
                '/^[\t\n\x0b\x0c ]+$/',
1777
                $token['data']
1778
            )
1779
        ) {
1780
            /* Append that character  to the Document node. */
1781
            $text = $this->dom->createTextNode($token['data']);
1782
            $this->dom->appendChild($text);
1783
        }
1784
    }
1785
1786
    private function rootElementPhase($token)
@@ 1805-1818 (lines=14) @@
1802
            /* A character token that is one of one of U+0009 CHARACTER TABULATION,
1803
            U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
1804
            or U+0020 SPACE */
1805
        } elseif ($token['type'] === HTML5::CHARACTR &&
1806
            preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])
1807
        ) {
1808
            /* Append that character  to the Document node. */
1809
            $text = $this->dom->createTextNode($token['data']);
1810
            $this->dom->appendChild($text);
1811
1812
            /* A character token that is not one of U+0009 CHARACTER TABULATION,
1813
                U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED
1814
                (FF), or U+0020 SPACE
1815
            A start tag token
1816
            An end tag token
1817
            An end-of-file token */
1818
        } elseif (($token['type'] === HTML5::CHARACTR &&
1819
                !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) ||
1820
            $token['type'] === HTML5::STARTTAG ||
1821
            $token['type'] === HTML5::ENDTAG ||