X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fspamcop%2Ffunctions.php;h=590785c247e1cf4a14f5e0d55798aba0f94e2aff;hp=d53f299b6148ff2a88e41a52e407517838f2195d;hb=24024eb7a3db834ca68720cd30fec275af758237;hpb=7dc06407b2f39bd3b18495185a9f3c05f6c3ae0c diff --git a/plugins/spamcop/functions.php b/plugins/spamcop/functions.php index d53f299b..590785c2 100644 --- a/plugins/spamcop/functions.php +++ b/plugins/spamcop/functions.php @@ -3,7 +3,7 @@ /** * SpamCop plugin - functions * - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright © 1999-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package plugins @@ -60,7 +60,7 @@ function spamcop_load_function() { * @access private */ function spamcop_show_link_function(&$links) { - global $spamcop_enabled, $spamcop_method, $spamcop_quick_report,$javascript_on; + global $spamcop_enabled, $spamcop_method, $spamcop_quick_report; if (! $spamcop_enabled) return; @@ -99,7 +99,7 @@ function spamcop_show_link_function(&$links) { $url = '../plugins/spamcop/spamcop.php?passed_id=' . urlencode($passed_id) . '&mailbox=' . urlencode($mailbox) . '&startMessage=' . urlencode($startMessage) . '&passed_ent_id=' . urlencode($passed_ent_id); - if ( $spamcop_method == 'web_form' && $javascript_on ) { + if ( $spamcop_method == 'web_form' && checkForJavascript() ) { $url .= '&js_web=1'; } @@ -180,9 +180,7 @@ function spamcop_enable_disable($option,$disable_action,$enable_action) { */ function spamcop_getMessage_RFC822_Attachment($message, $composeMessage, $passed_id, $passed_ent_id='', $imapConnection) { - global $attachment_dir, $username; - $hashed_attachment_dir = getHashedDir($username, $attachment_dir); if (!$passed_ent_id) { $body_a = sqimap_run_command($imapConnection, 'FETCH '.$passed_id.' RFC822', @@ -198,21 +196,12 @@ function spamcop_getMessage_RFC822_Attachment($message, $composeMessage, $passed array_shift($body_a); $body = implode('', $body_a) . "\r\n"; - $localfilename = GenerateRandomString(32, 'FILE', 7); - $full_localfilename = "$hashed_attachment_dir/$localfilename"; - $fp = fopen( $full_localfilename, 'w'); + $filename = sq_get_attach_tempfile(); + $fp = fopen($filename, 'wb'); fwrite ($fp, $body); fclose($fp); - - /* dirty relative dir fix */ - if (substr($attachment_dir,0,3) == '../') { - $attachment_dir = substr($attachment_dir,3); - $hashed_attachment_dir = getHashedDir($username, $attachment_dir); - } - $full_localfilename = "$hashed_attachment_dir/$localfilename"; - $composeMessage->initAttachment('message/rfc822','email.txt', - $full_localfilename); + $filename); } return $composeMessage; }