Przeglądaj źródła

Fix bug #550605, thanks to Cor Bosman.

Thijs Kinkhorst 23 lat temu
rodzic
commit
d306448f08
2 zmienionych plików z 12 dodań i 0 usunięć
  1. 1 0
      ChangeLog
  2. 11 0
      plugins/spamcop/spamcop.php

+ 1 - 0
ChangeLog

@@ -4,6 +4,7 @@
 
 
 Version 1.2.7 -- CVS
 Version 1.2.7 -- CVS
 --------------------
 --------------------
+  - Fix SpamCop plugin.
   - Fixed send MDN link.
   - Fixed send MDN link.
   - Fixed dealing with \r\n and \n in smtp.php. 
   - Fixed dealing with \r\n and \n in smtp.php. 
   - Fixed to, cc, bcc arrays in message->header
   - Fixed to, cc, bcc arrays in message->header

+ 11 - 0
plugins/spamcop/spamcop.php

@@ -16,6 +16,15 @@
     if ($spamcop_method == 'quick_email' || 
     if ($spamcop_method == 'quick_email' || 
         $spamcop_method == 'thorough_email') {
         $spamcop_method == 'thorough_email') {
        // Use email-based reporting -- save as an attachment
        // Use email-based reporting -- save as an attachment
+       if(!isset($composesession)) {
+        $composesession = 0;
+        session_register('composesession');
+       }
+       if (!isset($session)) {
+         $session = "$composesession" +1;
+           $composesession = $session;
+       }
+
        if (!isset($attachments)) {
        if (!isset($attachments)) {
           $attachments = array();
           $attachments = array();
           session_register('attachments');
           session_register('attachments');
@@ -33,6 +42,7 @@
        $newAttachment['localfilename'] = $file;
        $newAttachment['localfilename'] = $file;
        $newAttachment['remotefilename'] = 'email.txt';
        $newAttachment['remotefilename'] = 'email.txt';
        $newAttachment['type'] = 'message/rfc822';
        $newAttachment['type'] = 'message/rfc822';
+       $newAttachment['session'] = $session;
        $fp = fopen($attachment_dir . $file, 'w');
        $fp = fopen($attachment_dir . $file, 'w');
        foreach ($read as $line) {
        foreach ($read as $line) {
           fputs($fp, $line);
           fputs($fp, $line);
@@ -90,6 +100,7 @@ agree to follow SpamCop's rules/terms of service/etc.</p>
   <input type=hidden name="send_to_bcc" value="">
   <input type=hidden name="send_to_bcc" value="">
   <input type=hidden name="subject" value="reply anyway">
   <input type=hidden name="subject" value="reply anyway">
   <input type=hidden name="identity" value="default">
   <input type=hidden name="identity" value="default">
+  <input type=hidden name="session" value="<?PHP echo $session?>">
   <input type=submit name="send" value="Send Spam Report">
   <input type=submit name="send" value="Send Spam Report">
 <?PHP } else {
 <?PHP } else {
    $Message = implode('', $read);
    $Message = implode('', $read);