| | |
| | | return $vcard; |
| | | } |
| | | |
| | | private static function rfc2425_fold_callback($matches) |
| | | { |
| | | return ":\n ".rtrim(chunk_split($matches[1], 72, "\n ")); |
| | | } |
| | | |
| | | private static function rfc2425_fold($val) |
| | | { |
| | | return preg_replace('/:([^\n]{72,})/e', '":\n ".rtrim(chunk_split("\\1", 72, "\n "))', $val) . "\n"; |
| | | return preg_replace_callback('/:([^\n]{72,})/', array('self', 'rfc2425_fold_callback'), $val) . "\n"; |
| | | } |
| | | |
| | | |
| | |
| | | $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) { |