From 2b0f4faf44f1d51c04895f802156d44cc80a40e3 Mon Sep 17 00:00:00 2001 From: kink Date: Tue, 18 Jan 2005 16:09:19 +0000 Subject: [PATCH] Remove printer friendly clean display option, following a proposal of mine on the devel list to which no objections arose. The option is totally unclear to end users, and has very little impact. The cleaning is now always done. If it turns out this is really missed, or if people really want to turn the cleaning off, it can of course always be reintroduced - that's why this is devel. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8675 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 2 ++ include/load_prefs.php | 3 +-- include/options/display.php | 9 +-------- src/printer_friendly_bottom.php | 30 +++++++++++------------------- 4 files changed, 15 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f27f15f..22ad1212 100644 --- a/ChangeLog +++ b/ChangeLog @@ -181,6 +181,8 @@ Version 1.5.1 -- CVS unlimited. (#1094569). - Security: Added hook for Preferences Backend to resolve potential file inclusions. [CAN-2005-0075] + - Remove Printer Friendly Clean Display config option, the cleaning + is now always done. Version 1.5.0 -------------------- diff --git a/include/load_prefs.php b/include/load_prefs.php index 5febad51..7f566719 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -231,7 +231,6 @@ $enable_forward_as_attachment = $show_xmailer_default = getPref($data_dir, $username, 'show_xmailer_default', SMPREF_OFF ); $attachment_common_show_images = getPref($data_dir, $username, 'attachment_common_show_images', SMPREF_OFF ); -$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay', SMPREF_OFF); /* message disposition notification support setting */ $mdn_user_support = getPref($data_dir, $username, 'mdn_user_support', SMPREF_ON); @@ -298,4 +297,4 @@ $delete_prev_next_display = getPref($data_dir, $username, 'delete_prev_next_disp do_hook('loading_prefs'); -?> \ No newline at end of file +?> diff --git a/include/options/display.php b/include/options/display.php index e03e849c..e1cb1734 100644 --- a/include/options/display.php +++ b/include/options/display.php @@ -361,13 +361,6 @@ function load_optpage_data_display() { 'refresh' => SMOPT_REFRESH_NONE ); - $optvals[SMOPT_GRP_MESSAGE][] = array( - 'name' => 'pf_cleandisplay', - 'caption' => _("Enable Printer Friendly Clean Display"), - 'type' => SMOPT_TYPE_BOOLEAN, - 'refresh' => SMOPT_REFRESH_NONE - ); - if ($default_use_mdn) { $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'mdn_user_support', @@ -536,4 +529,4 @@ function save_option_reply_prefix($option) { } -?> \ No newline at end of file +?> diff --git a/src/printer_friendly_bottom.php b/src/printer_friendly_bottom.php index c2c1286f..4afb3e94 100644 --- a/src/printer_friendly_bottom.php +++ b/src/printer_friendly_bottom.php @@ -38,7 +38,6 @@ if (! sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET) ) { } /* end globals */ -$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay', false); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $mbx_response = sqimap_mailbox_select($imapConnection, $mailbox); if (isset($messages[$mbx_response['UIDVALIDITY']][$passed_id])) { @@ -79,27 +78,20 @@ if ($ent_ar[0] != '') { $body = _("Message not printable"); } - /* now, if they choose to, we clean up the display a bit... */ +/* now we clean up the display a bit... */ -if ($pf_cleandisplay) { +$num_leading_spaces = 9; // nine leading spaces for indentation - $num_leading_spaces = 9; // nine leading spaces for indentation +// sometimes I see ',,' instead of ',' seperating addresses *shrug* +$cc = pf_clean_string(str_replace(',,', ',', $cc), $num_leading_spaces); +$to = pf_clean_string(str_replace(',,', ',', $to), $num_leading_spaces); - // sometimes I see ',,' instead of ',' seperating addresses *shrug* - $cc = pf_clean_string(str_replace(',,', ',', $cc), $num_leading_spaces); - $to = pf_clean_string(str_replace(',,', ',', $to), $num_leading_spaces); +// clean up everything else... +$subject = pf_clean_string($subject, $num_leading_spaces); +$from = pf_clean_string($from, $num_leading_spaces); +$date = pf_clean_string($date, $num_leading_spaces); - // the body should have no leading zeros - // disabled because it destroys html mail - -// $body = pf_clean_string($body, 0); - - // clean up everything else... - $subject = pf_clean_string($subject, $num_leading_spaces); - $from = pf_clean_string($from, $num_leading_spaces); - $date = pf_clean_string($date, $num_leading_spaces); - -} // end cleanup +// end cleanup $to = decodeHeader($to); $cc = decodeHeader($cc); @@ -194,4 +186,4 @@ function pf_clean_string ( $unclean_string, $num_leading_spaces ) { } /* end pf_clean_string() function */ /* --end pf-specific functions */ -?> \ No newline at end of file +?> -- 2.25.1