- Add password type option widget
- Make all submit button names unique on compose screen
- Make address book file permissions 0600 - same as preference files
+ - Added compatibility with Dovecot's bigint UIDs
Version 1.5.1 (branched on 2006-02-12)
--------------------------------------
*/
function sqimap_get_message($imap_stream, $id, $mailbox, $hide=0) {
// typecast to int to prohibit 1:* msgs sets
- $id = (int) $id;
+ // Update: $id should always be sanitized into a BIGINT so this
+ // is being removed; leaving this code here in case something goes
+ // wrong, however
+ //$id = (int) $id;
$flags = array();
$read = sqimap_run_command($imap_stream, "FETCH $id (FLAGS BODYSTRUCTURE)", true, $response, $message, TRUE);
if ($read) {
/* retrieve the check boxes */
$aUid = (isset($msg) && is_array($msg)) ? array_values($msg) : $aUid;
if (count($aUid) && $sButton != 'expunge') {
+
+ // make sure message UIDs are sanitized (BIGINT)
+ foreach ($aUid as $i => $uid)
+ $aUid[$i] = (preg_match('/^[0-9]+$/', $uid) ? $uid : '0');
+
$aUpdatedMsgs = false;
$bExpunge = false;
switch ($sButton) {
$msgd_8bit_in_hex=false;
if (!empty($md_action)) {
- sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+ sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET))
$passed_ent_id = 0;
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
displayHtmlHeader( _("Message Details"), '', FALSE );
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
-sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET))
$passed_ent_id = 0;
"-->\n".
"</script>\n", FALSE );
-sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET))
$passed_ent_id = 0;
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
return;
/* GLOBALS */
- sqgetGlobalVar('passed_id', $passed_id, SQ_FORM);
+ sqgetGlobalVar('passed_id', $passed_id, SQ_FORM, NULL, SQ_TYPE_BIGINT);
sqgetGlobalVar('passed_ent_id',$passed_ent_id,SQ_FORM);
sqgetGlobalVar('mailbox', $mailbox, SQ_FORM);
if ( sqgetGlobalVar('startMessage', $startMessage, SQ_FORM) ) {
/* GLOBALS */
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
-sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
sqgetGlobalVar('js_web', $js_web, SQ_GET);
if (! sqgetGlobalVar('startMessage', $startMessage, SQ_GET) ) {
sqgetGlobalVar('request_dr',$request_dr, $SQ_GLOBAL);
sqgetGlobalVar('html_addr_search',$html_addr_search, $SQ_GLOBAL);
sqgetGlobalVar('mail_sent',$mail_sent, $SQ_GLOBAL);
-sqgetGlobalVar('passed_id',$passed_id, $SQ_GLOBAL);
+sqgetGlobalVar('passed_id',$passed_id, $SQ_GLOBAL, NULL, SQ_TYPE_BIGINT);
sqgetGlobalVar('passed_ent_id',$passed_ent_id, $SQ_GLOBAL);
sqgetGlobalVar('attach',$attach, SQ_POST);
sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
sqgetGlobalVar('absolute_dl',$absolute_dl, SQ_GET);
sqgetGlobalVar('force_crlf', $force_crlf, SQ_GET);
-if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) {
- $passed_id = (int) $temp;
-}
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
if (!sqgetGlobalVar('account', $account, SQ_GET) ) {
$account = 0;
}
displayPageHeader($color);
/* globals */
-if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) {
- $passed_id = (int) $temp;
-}
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER);
}
/** GET/POST VARS */
+sqgetGlobalVar('passed_id', $passed_id, SQ_INORDER, NULL, SQ_TYPE_BIGINT);
sqgetGlobalVar('passed_ent_id', $passed_ent_id);
sqgetGlobalVar('mailbox', $mailbox);
-if ( sqgetGlobalVar('passed_id', $temp) ) {
- $passed_id = (int) $temp;
-}
if ( sqgetGlobalVar('sort', $temp) ) {
$sort = (int) $temp;
}
/* 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);
}
/* get global vars */
-if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) {
- $passed_id = (int) $temp;
-}
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
if ( sqgetGlobalVar('mailbox', $temp, SQ_GET) ) {
$mailbox = $temp;
}
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET);
-if (sqgetGlobalVar('passed_id', $temp, SQ_GET)) {
- $passed_id = (int) $temp;
-}
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
// TODO: add required var checks here.
sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET);
sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER);
-if (sqgetGlobalVar('passed_id', $temp, SQ_GET)) {
- $passed_id = (int) $temp;
-}
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox);