Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 77733865

Von Moritz Bunkus vor mehr als 16 Jahren hinzugefügt

  • ID 77733865782a76d067540b70304ff3dab7a1ab8c
  • Vorgänger bbc63419
  • Nachfolger 3bc869dd

Email-Versand: Adressen beim Quoten nicht umbrechen.

Unterschiede anzeigen:

SL/Mailer.pm
57 57
  my $l_start = length($q_start);
58 58

  
59 59
  my $new_text = "$q_start";
60
  $chars_left -= $l_start;
60
  $chars_left -= $l_start if (defined $chars_left);
61 61

  
62 62
  for (my $i = 0; $i < length($text); $i++) {
63 63
    my $char = ord(substr($text, $i, 1));
64 64

  
65
    if (($char < 32) || ($char > 127) ||
66
        ($char == ord('?')) || ($char == ord('_'))) {
67
      if ($chars_left < 5) {
65
    if (($char < 32) || ($char > 127) || ($char == ord('?')) || ($char == ord('_'))) {
66
      if ((defined $chars_left) && ($chars_left < 5)) {
68 67
        $new_text .= "?=\n $q_start";
69 68
        $chars_left = 75 - $l_start;
70 69
      }
71 70

  
72 71
      $new_text .= sprintf("=%02X", $char);
73
      $chars_left -= 3;
72
      $chars_left -= 3 if (defined $chars_left);
74 73

  
75 74
    } else {
76 75
      $char = ord('_') if ($char == ord(' '));
77
      if ($chars_left < 5) {
76
      if ((defined $chars_left) && ($chars_left < 5)) {
78 77
        $new_text .= "?=\n $q_start";
79 78
        $chars_left = 75 - $l_start;
80 79
      }
81 80

  
82 81
      $new_text .= chr($char);
83
      $chars_left--;
82
      $chars_left-- if (defined $chars_left);
84 83
    }
85 84
  }
86 85

  
......
138 137
    next unless (scalar @addr_objects);
139 138

  
140 139
    foreach my $addr_obj (@addr_objects) {
141
      $addr_obj->phrase($self->mime_quote_text($addr_obj->phrase(), 60))   if ($addr_obj->phrase());
142
      $addr_obj->comment($self->mime_quote_text($addr_obj->comment(), 60)) if ($addr_obj->comment());
140
      my $phrase = $addr_obj->phrase();
141
      if ($phrase) {
142
        $phrase =~ s/^\"//;
143
        $phrase =~ s/\"$//;
144
        $addr_obj->phrase($self->mime_quote_text($phrase));
145
      }
143 146

  
144 147
      $headers .= sprintf("%s: %s\n", ucfirst($item), $addr_obj->format());
145 148
    }

Auch abrufbar als: Unified diff