Code Duplication    Length = 4-5 lines in 2 locations

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

@@ 4595-4599 (lines=5) @@
4592
      $diff = $pad_length - $str_length;
4593
4594
      switch ($pad_type) {
4595
        case STR_PAD_LEFT:
4596
          $pre = str_repeat($pad_string, (int)ceil($diff / $ps_length));
4597
          $pre = (string)self::substr($pre, 0, $diff);
4598
          $post = '';
4599
          break;
4600
4601
        case STR_PAD_BOTH:
4602
          $pre = str_repeat($pad_string, (int)ceil($diff / $ps_length / 2));
@@ 4609-4612 (lines=4) @@
4606
          break;
4607
4608
        case STR_PAD_RIGHT:
4609
        default:
4610
          $post = str_repeat($pad_string, (int)ceil($diff / $ps_length));
4611
          $post = (string)self::substr($post, 0, $diff);
4612
          $pre = '';
4613
      }
4614
4615
      return $pre . $str . $post;