Code Duplication    Length = 9-9 lines in 6 locations

includes/libraries/protect/AntiXSS/UTF8.php 6 locations

@@ 5171-5179 (lines=9) @@
5168
      $needle = self::clean($needle);
5169
    }
5170
5171
    if (
5172
        $encoding === 'UTF-8'
5173
        ||
5174
        $encoding === true || $encoding === false // INFO: the "bool"-check is only a fallback for old versions
5175
    ) {
5176
      $encoding = 'UTF-8';
5177
    } else {
5178
      $encoding = self::normalize_encoding($encoding, 'UTF-8');
5179
    }
5180
5181
    if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) {
5182
      self::checkForSupport();
@@ 5293-5301 (lines=9) @@
5290
      return 0;
5291
    }
5292
5293
    if (
5294
        $encoding === 'UTF-8'
5295
        ||
5296
        $encoding === true || $encoding === false // INFO: the "bool"-check is only a fallback for old versions
5297
    ) {
5298
      $encoding = 'UTF-8';
5299
    } else {
5300
      $encoding = self::normalize_encoding($encoding, 'UTF-8');
5301
    }
5302
5303
    switch ($encoding) {
5304
      case 'ASCII':
@@ 5518-5526 (lines=9) @@
5515
      $haystack = self::clean($haystack);
5516
    }
5517
5518
    if (
5519
        $encoding === 'UTF-8'
5520
        ||
5521
        $encoding === true || $encoding === false // INFO: the "bool"-check is only a fallback for old versions
5522
    ) {
5523
      $encoding = 'UTF-8';
5524
    } else {
5525
      $encoding = self::normalize_encoding($encoding, 'UTF-8');
5526
    }
5527
5528
    if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) {
5529
      self::checkForSupport();
@@ 5751-5759 (lines=9) @@
5748
      $haystack = self::clean($haystack);
5749
    }
5750
5751
    if (
5752
        $encoding === 'UTF-8'
5753
        ||
5754
        $encoding === true || $encoding === false // INFO: the "bool"-check is only a fallback for old versions
5755
    ) {
5756
      $encoding = 'UTF-8';
5757
    } else {
5758
      $encoding = self::normalize_encoding($encoding, 'UTF-8');
5759
    }
5760
5761
    if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) {
5762
      self::checkForSupport();
@@ 5834-5842 (lines=9) @@
5831
      $haystack = self::clean($haystack);
5832
    }
5833
5834
    if (
5835
        $encoding === 'UTF-8'
5836
        ||
5837
        $encoding === true || $encoding === false // INFO: the "bool"-check is only a fallback for old versions
5838
    ) {
5839
      $encoding = 'UTF-8';
5840
    } else {
5841
      $encoding = self::normalize_encoding($encoding, 'UTF-8');
5842
    }
5843
5844
    if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) {
5845
      self::checkForSupport();
@@ 6333-6341 (lines=9) @@
6330
      $length = (int)$length;
6331
    }
6332
6333
    if (
6334
        $encoding === 'UTF-8'
6335
        ||
6336
        $encoding === true || $encoding === false // INFO: the "bool"-check is only a fallback for old versions
6337
    ) {
6338
      $encoding = 'UTF-8';
6339
    } else {
6340
      $encoding = self::normalize_encoding($encoding, 'UTF-8');
6341
    }
6342
6343
    if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) {
6344
      self::checkForSupport();