From 856e58ef5660063838b0ad5e457dcfeea195f8a2 Mon Sep 17 00:00:00 2001 From: kink Date: Fri, 8 Jun 2007 19:42:55 +0000 Subject: [PATCH] drop some unused globals git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12447 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/addrbook_search.php | 2 -- src/addrbook_search_html.php | 6 +----- src/compose.php | 21 +++++++++++---------- src/printer_friendly_main.php | 1 - src/read_body.php | 10 +++------- src/redirect.php | 5 +++-- 6 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/addrbook_search.php b/src/addrbook_search.php index cfbe3ba8..b2e33774 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -63,7 +63,6 @@ displayHtmlHeader(); echo "\n"; /** set correct value of $default_charset */ -global $default_charset; set_my_charset(); /* Empty search */ @@ -140,4 +139,3 @@ if ($show == 'form' && ! isset($listall)) { } $oTemplate->display('footer.tpl'); -?> \ No newline at end of file diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index b877ca22..a534da0a 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -68,9 +68,7 @@ function addr_insert_hidden() { * @param bool $includesource If true, adds backend column to address listing */ function addr_display_result($res, $includesource = true) { - global $color, $PHP_SELF, $squirrelmail_language; - - global $oTemplate, $oErrorHandler; + global $PHP_SELF, $oTemplate, $oErrorHandler; echo addForm($PHP_SELF, 'post', 'addressbook'). @@ -96,7 +94,6 @@ else { } /** set correct value of $default_charset */ -global $default_charset; set_my_charset(); /* Initialize addressbook */ @@ -176,4 +173,3 @@ if ($addrquery == '' || sizeof($res) == 0) { echo '
'; $oTemplate->display('footer.tpl'); -?> diff --git a/src/compose.php b/src/compose.php index 30b2fcda..1a44f25b 100644 --- a/src/compose.php +++ b/src/compose.php @@ -722,8 +722,8 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se $use_signature, $data_dir, $username, $key, $imapServerAddress, $imapPort, $compose_messages, $composeMessage, $body_quote, $request_mdn, $request_dr, - $default_use_mdn, $mdn_user_support; - global $languages, $squirrelmail_language, $default_charset; + $mdn_user_support, $languages, $squirrelmail_language, + $default_charset; /* * Set $default_charset to correspond with the user's selection @@ -1055,10 +1055,11 @@ function getMessage_RFC822_Attachment($message, $composeMessage, $passed_id, } function showInputForm ($session, $values=false) { - global $send_to, $send_to_cc, $body, $startMessage, $action, - $color, $use_signature, $signature, $prefix_sig, + global $send_to, $send_to_cc, $send_to_bcc, + $body, $startMessage, $action, + $use_signature, $signature, $prefix_sig, $editor_size, $editor_height, $subject, $newmail, - $use_javascript_addr_book, $send_to_bcc, $passed_id, $mailbox, + $use_javascript_addr_book, $passed_id, $mailbox, $from_htmladdr_search, $location_of_buttons, $attachment_dir, $username, $data_dir, $identity, $idents, $delete_draft, $mailprio, $compose_new_win, $saved_draft, $mail_sent, $sig_first, @@ -1436,9 +1437,9 @@ function getByteSize($ini_size) { function deliverMessage($composeMessage, $draft=false) { global $send_to, $send_to_cc, $send_to_bcc, $mailprio, $subject, $body, $username, $identity, $idents, $data_dir, - $request_mdn, $request_dr, $default_charset, $color, $useSendmail, - $domain, $action, $default_move_to_sent, $move_to_sent; - global $imapServerAddress, $imapPort, $sent_folder, $key; + $request_mdn, $request_dr, $default_charset, $useSendmail, + $domain, $action, $default_move_to_sent, $move_to_sent, + $imapServerAddress, $imapPort, $sent_folder, $key; $rfc822_header = $composeMessage->rfc822_header; @@ -1607,8 +1608,8 @@ function deliverMessage($composeMessage, $draft=false) { $lcl_allow_sent = false; } + global $passed_id, $mailbox; if (($fld_sent && $svr_allow_sent && !$lcl_allow_sent) || ($fld_sent && $lcl_allow_sent)) { - global $passed_id, $mailbox, $action; if ($action == 'reply' || $action == 'reply_all') { $save_reply_with_orig=getPref($data_dir,$username,'save_reply_with_orig'); if ($save_reply_with_orig) { @@ -1623,7 +1624,7 @@ function deliverMessage($composeMessage, $draft=false) { unset ($imap_deliver); } - global $passed_id, $mailbox, $action, $what, $iAccount,$startMessage; + global $what, $iAccount, $startMessage; $composeMessage->purgeAttachments(); if ($action=='reply' || $action=='reply_all' || $action=='forward' || $action=='forward_as_attachment') { diff --git a/src/printer_friendly_main.php b/src/printer_friendly_main.php index 8632c630..7979ea55 100644 --- a/src/printer_friendly_main.php +++ b/src/printer_friendly_main.php @@ -15,7 +15,6 @@ include('../include/init.php'); /* get those globals into gear */ -global $color; if ( ! sqgetGlobalVar('passed_ent_id',$passed_ent_id,SQ_GET)) $passed_ent_id = 0; if ( ! sqgetGlobalVar('mailbox',$mailbox,SQ_GET) || diff --git a/src/read_body.php b/src/read_body.php index 41973190..1fb0ab64 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -125,8 +125,7 @@ function ServerMDNSupport($aFlags) { } function SendMDN ( $mailbox, $passed_id, $message, $imapConnection) { - global $username, $attachment_dir, $color, - $squirrelmail_language, $default_charset, + global $squirrelmail_language, $default_charset, $languages, $useSendmail, $domain, $sent_folder; sqgetGlobalVar('SERVER_NAME', $SERVER_NAME, SQ_SERVER); @@ -271,7 +270,7 @@ function SendMDN ( $mailbox, $passed_id, $message, $imapConnection) { _("Server replied:") . ' ' . $deliver->dlv_ret_nr . ' ' . nl2br(htmlspecialchars($deliver->dlv_server_msg)); } - plain_error_message($msg, $color); + plain_error_message($msg); } else { unset ($deliver); if (sqimap_mailbox_exists ($imapConnection, $sent_folder)) { @@ -294,7 +293,7 @@ function ToggleMDNflag ($set ,$imapConnection, $mailbox, $passed_id) { } function formatRecipientString($recipients, $item ) { - global $show_more_cc, $show_more, $show_more_bcc, + global $show_more, $show_more_cc, $show_more_bcc, $PHP_SELF, $oTemplate; $string = ''; @@ -447,8 +446,6 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed $urlMailbox = urlencode($mailbox); - $msgs_url = $base_uri . 'src/'; - // Create Prev & Next links // Handle nested entities first (i.e. Mime Attach parts) $prev_href = $next_href = $up_href = $del_href = $del_prev_href = $del_next_href = ''; @@ -787,7 +784,6 @@ if(sqgetGlobalVar('view_unsafe_images', $temp)) { sqgetGlobalVar('mailbox_cache',$mailbox_cache,SQ_SESSION); /* end of get globals */ -global $sqimap_capabilities, $lastTargetMailbox; $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); $aMailbox = sqm_api_mailbox_select($imapConnection, $iAccount, $mailbox,array('setindex' => $what, 'offset' => $startMessage),array()); diff --git a/src/redirect.php b/src/redirect.php index cce56c61..d3058019 100644 --- a/src/redirect.php +++ b/src/redirect.php @@ -172,8 +172,6 @@ exit; function attachment_common_parse($str, $debug) { global $attachment_common_types, $attachment_common_types_parsed; - $attachment_common_types_parsed[$str] = true; - /* * Replace ", " with "," and explode on that as Mozilla 1.x seems to * use "," to seperate whilst IE, and earlier versions of Mozilla use @@ -193,4 +191,7 @@ function attachment_common_parse($str, $debug) { } } sqsession_register($attachment_common_types, 'attachment_common_types'); + + /* mark as parsed */ + $attachment_common_types_parsed[$str] = true; } -- 2.25.1