# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: contributions/modules/vcard/vcard.module
--- contributions/modules/vcard/vcard.module Base (1.17.2.5)
+++ contributions/modules/vcard/vcard.module Locally Modified (Based On 1.17.2.5)
@@ -20,7 +20,7 @@
   $t = get_t();
   $init = _vcard_init();
 
-  if ($phase == 'runtime') {
+  if ($phase === 'runtime') {
     $requirement['vcard'] = array(
       'title' => t('PEAR Contact_Vcard_Build'),
       'value' => $init ? t('Available.') : t('Not available.'),
@@ -81,8 +81,8 @@
     'access arguments' => array('administer vcard'),
     'file' => 'vcard.admin.inc',
   );
-  $items['user/%/vcard'] = array(
-    'title' => t('vcard'),
+  $items['user/%user/vcard'] = array(
+    'title' => 'vcard',
     'type' => MENU_CALLBACK,
     'page callback' => 'vcard_fetch',
     'page arguments' => array(1),
@@ -131,8 +131,7 @@
 /**
  * Retrieve a user's vcard
  */
-function vcard_get($uid) {
-  $account = user_load(array('uid' => $uid));
+function vcard_get($account) {
   $vcard = _vcard_init();
 
   $first = vcard_get_field('givenname', $account);
@@ -190,7 +189,7 @@
 
   $vcard->addAddress('', '', $street, $city, $province, $postal, $country);
 
-  if ($account->location['latitude'] && $account->location['longitude']) {
+  if (!empty($account->location['latitude']) && !empty($account->location['longitude'])) {
     $vcard->setGeo($account->location['latitude'], $account->location['longitude']);
   }
 
@@ -200,8 +199,8 @@
 /**
  * VCard for direct download
  */
-function vcard_fetch($uid) {
-  $vcard = vcard_get($uid);
+function vcard_fetch($account) {
+  $vcard = vcard_get($account);
   header('Content-type: text/x-vcard');
   header('Content-Disposition: attachment; filename="'. $account->name .'.vcf"');
   print $vcard->fetch();
@@ -218,7 +217,7 @@
     $vcard_map[$account->uid] = _vcard_get_map($account);
   }
   
-  return $vcard_map[$account->uid][$field];
+  return isset($vcard_map[$account->uid][$field]) ? $vcard_map[$account->uid][$field] : '';
 }
 
 /**
