Code Duplication    Length = 19-27 lines in 3 locations

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

@@ 1243-1268 (lines=26) @@
1240
        }
1241
    }
1242
1243
    private function commentState()
1244
    {
1245
        /* Consume the next input character: */
1246
        $this->char++;
1247
        $char = $this->char();
1248
1249
        /* U+002D HYPHEN-MINUS (-) */
1250
        if ($char === '-') {
1251
            /* Switch to the comment dash state  */
1252
            $this->state = 'commentDash';
1253
1254
            /* EOF */
1255
        } elseif ($this->char === $this->EOF) {
1256
            /* Parse error. Emit the comment token. Reconsume the EOF character
1257
            in the data state. */
1258
            $this->emitToken($this->token);
1259
            $this->char--;
1260
            $this->state = 'data';
1261
1262
            /* Anything else */
1263
        } else {
1264
            /* Append the input character to the comment token's data. Stay in
1265
            the comment state. */
1266
            $this->token['data'] .= $char;
1267
        }
1268
    }
1269
1270
    private function commentDashState()
1271
    {
@@ 1270-1296 (lines=27) @@
1267
        }
1268
    }
1269
1270
    private function commentDashState()
1271
    {
1272
        /* Consume the next input character: */
1273
        $this->char++;
1274
        $char = $this->char();
1275
1276
        /* U+002D HYPHEN-MINUS (-) */
1277
        if ($char === '-') {
1278
            /* Switch to the comment end state  */
1279
            $this->state = 'commentEnd';
1280
1281
            /* EOF */
1282
        } elseif ($this->char === $this->EOF) {
1283
            /* Parse error. Emit the comment token. Reconsume the EOF character
1284
            in the data state. */
1285
            $this->emitToken($this->token);
1286
            $this->char--;
1287
            $this->state = 'data';
1288
1289
            /* Anything else */
1290
        } else {
1291
            /* Append a U+002D HYPHEN-MINUS (-) character and the input
1292
            character to the comment token's data. Switch to the comment state. */
1293
            $this->token['data'] .= '-' . $char;
1294
            $this->state = 'comment';
1295
        }
1296
    }
1297
1298
    private function commentEndState()
1299
    {
@@ 1443-1461 (lines=19) @@
1440
        }
1441
    }
1442
1443
    private function bogusDoctypeState()
1444
    {
1445
        /* Consume the next input character: */
1446
        $this->char++;
1447
        $char = $this->char();
1448
1449
        if ($char === '>') {
1450
            $this->emitToken($this->token);
1451
            $this->state = 'data';
1452
1453
        } elseif ($this->char === $this->EOF) {
1454
            $this->emitToken($this->token);
1455
            $this->char--;
1456
            $this->state = 'data';
1457
1458
        } else {
1459
            // Stay in the bogus DOCTYPE state.
1460
        }
1461
    }
1462
1463
    private function entity()
1464
    {