Happy New Year
[squirrelmail.git] / src / vcard.php
index 7589bfece78ed519188f6e18139bf8f78bbceda9..cde642417bed0cf9e66398131dfd1c1a2340d458 100644 (file)
@@ -5,12 +5,15 @@
  *
  * This file shows an attched vcard
  *
- * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @copyright 1999-2020 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  */
 
+/** This is the vcard page */
+define('PAGE_NAME', 'vcard');
+
 /**
  * Include the SquirrelMail initialization file.
  */
@@ -32,16 +35,17 @@ include_once(SM_PATH . 'functions/imap_messages.php');
 
 /* globals */
 
-sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
 sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
 sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
 sqgetGlobalVar('startMessage', $startMessage, SQ_GET);
 /* end globals */
 
-$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imap_stream_options; // in case not defined in config
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imap_stream_options);
 sqimap_mailbox_select($imapConnection, $mailbox);
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 $msg_url = 'read_body.php?mailbox='.urlencode($mailbox).
     '&startMessage='.urlencode($startMessage).
@@ -83,7 +87,7 @@ if ($vcard_nice['version'] == '2.1') {
        $vcard_nice['email;internet'] = $vcard_nice['email;pref;internet'];
     }
 } else {
-    $oTemplate->assign('note', sprintf(_("vCard Version %s is not supported. Some information might not be converted correctly."), htmlspecialchars($vcard_nice['version'])));
+    $oTemplate->assign('note', sprintf(_("vCard Version %s is not supported. Some information might not be converted correctly."), sm_encode_html_special_chars($vcard_nice['version'])));
     $oTemplate->display('note.tpl');
 
     $vcard_nice['firstname'] = '';
@@ -91,7 +95,7 @@ if ($vcard_nice['version'] == '2.1') {
 }
 
 foreach ($vcard_nice as $k => $v) {
-    $v = htmlspecialchars($v);
+    $v = sm_encode_html_special_chars($v);
     $v = trim($v);
     $vcard_safe[$k] = trim(nl2br($v));
 }
@@ -185,4 +189,3 @@ $oTemplate->assign('info', $opts);
 $oTemplate->display('vcard.tpl');
 
 $oTemplate->display('footer.tpl');
-?>
\ No newline at end of file