From: kink Date: Sat, 11 Jan 2003 13:30:17 +0000 (+0000) Subject: Two fixes for vcard.php, thanks to Kurt Pires. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=40a9d8b3c9e481f732027b3c0ea8050f111150d0;p=squirrelmail.git Two fixes for vcard.php, thanks to Kurt Pires. 1) be liberal in what you accept 2) workaround for outlook, not doing a complete rewrite of vcard now but that's something that should definately be considered. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4412 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/vcard.php b/src/vcard.php index 2560fe62..417ea07c 100644 --- a/src/vcard.php +++ b/src/vcard.php @@ -69,7 +69,7 @@ foreach ($vcard as $l) { if ($attr == 'quoted-printable') $v = quoted_printable_decode($v); else - $k .= ';' . $attr; + $k .= ';' . strtolower($attr); } $v = str_replace(';', "\n", $v); @@ -78,10 +78,15 @@ foreach ($vcard as $l) { if ($vcard_nice['version'] == '2.1') { // get firstname and lastname for sm addressbook - $vcard_nice["firstname"] = substr($vcard_nice["n"], - strpos($vcard_nice["n"], "\n") + 1, strlen($vcard_nice["n"])); - $vcard_nice["lastname"] = substr($vcard_nice["n"], 0, - strpos($vcard_nice["n"], "\n")); + $vcard_nice['firstname'] = substr($vcard_nice['n'], + strpos($vcard_nice['n'], "\n") + 1, strlen($vcard_nice['n'])); + $vcard_nice['lastname'] = substr($vcard_nice['n'], 0, + strpos($vcard_nice['n'], "\n")); + // workaround for Outlook, should be fixed in a better way, + // maybe in new 'vCard' class. + if (isset($vcard_nice['email;pref;internet'])) { + $vcard_nice['email;internet'] = $vcard_nice['email;pref;internet']; + } } else { echo 'vCard Version ' . $vcard_nice['version'] . ' is not supported. Some information might not be converted ' .