From 32a7b3e05f69fdf4dd7edd4882cc7208987a7117 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Sun, 5 Apr 2009 06:35:15 +0000 Subject: [PATCH] Update to work with 1.5.2 - this was old 1.4.x code git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13525 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/sent_subfolders/functions.php | 11 ++++------- plugins/sent_subfolders/setup.php | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/plugins/sent_subfolders/functions.php b/plugins/sent_subfolders/functions.php index ae8140b1..3df9b318 100644 --- a/plugins/sent_subfolders/functions.php +++ b/plugins/sent_subfolders/functions.php @@ -12,26 +12,23 @@ * @subpackage sent_subfolders */ -function sent_subfolders_check_handleAsSent_do() { +function sent_subfolders_check_handleAsSent_do($mailbox) { global $handleAsSent_result, $sent_subfolders_base, $use_sent_subfolders; - // FIXME: hardcoded folder - $sent_subfolders_base = 'INBOX.Sent'; - $args = func_get_arg(0); sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); /* Only check the folder string if we have been passed a mailbox. */ - if ($use_sent_subfolders && (count($args) > 1)) { + if ($use_sent_subfolders && !empty($mailbox)) { /* Chop up the folder strings as needed. */ $base_str = $sent_subfolders_base . $delimiter; - $mbox_str = substr($args[1], 0, strlen($base_str)); + $mbox_str = substr($mailbox, 0, strlen($base_str)); /* Perform the comparison. */ $handleAsSent_result = ( $handleAsSent_result || ($base_str == $mbox_str) - || ($sent_subfolders_base == $args[1]) + || ($sent_subfolders_base == $mailbox) ); } } diff --git a/plugins/sent_subfolders/setup.php b/plugins/sent_subfolders/setup.php index 9eb723ed..efe2db11 100644 --- a/plugins/sent_subfolders/setup.php +++ b/plugins/sent_subfolders/setup.php @@ -57,9 +57,9 @@ function squirrelmail_plugin_init_sent_subfolders() { 'sent_subfolders_special_mailbox'; } -function sent_subfolders_check_handleAsSent() { +function sent_subfolders_check_handleAsSent($mailbox) { include_once(SM_PATH . 'plugins/sent_subfolders/functions.php'); - sent_subfolders_check_handleAsSent_do(); + sent_subfolders_check_handleAsSent_do($mailbox); } /** -- 2.25.1