alecpl
2009-05-04 23a2eec4d540b5f971ed6377e7ad776456ee0633
program/include/rcube_vcard.php
@@ -233,7 +233,7 @@
  private static function rfc2425_fold($val)
  {
    return preg_replace_callback('/:([^\n]{72,})/', 'self::rfc2425_fold_callback', $val) . "\n";
    return preg_replace_callback('/:([^\n]{72,})/', array('self', 'rfc2425_fold_callback'), $val) . "\n";
  }
@@ -263,15 +263,15 @@
          $line[1] .= ';' . (strpos($prop, '=') ? $prop : 'TYPE='.$prop);
      }
      if (!preg_match('/^(BEGIN|END)$/', $line[1]) && preg_match_all('/([^\\;]+);?/', $line[1], $regs2)) {
      if (!preg_match('/^(BEGIN|END)$/i', $line[1]) && preg_match_all('/([^\\;]+);?/', $line[1], $regs2)) {
        $entry = array('');
        $field = $regs2[1][0];
        $field = strtoupper($regs2[1][0]);
        foreach($regs2[1] as $attrid => $attr) {
          if ((list($key, $value) = explode('=', $attr)) && $value) {
            if ($key == 'ENCODING') {
              # add next line(s) to value string if QP line end detected
              while ($value == 'QUOTED-PRINTABLE' && ereg('=$', $lines[$i]))
              while ($value == 'QUOTED-PRINTABLE' && preg_match('/=$/', $lines[$i]))
                  $line[2] .= "\n" . $lines[++$i];
              
              $line[2] = self::decode_value($line[2], $value);