[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail: [12903]
From:       pdontthink () users ! sourceforge ! net
Date:       2008-01-29 23:36:14
Message-ID: E1JJzzy-0005GC-81 () sc8-pr-svn2 ! sourceforge ! net
[Download RAW message or body]

Revision: 12903
          http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=12903&view=rev
Author:   pdontthink
Date:     2008-01-29 15:36:14 -0800 (Tue, 29 Jan 2008)

Log Message:
-----------
Don't let more general attachment plugins override changes made by specific ones; \
also judge by changes to the defaultlink in addition to added links.  Thanks to \
Thierry Godefroy.

Modified Paths:
--------------
    trunk/squirrelmail/functions/mime.php

Modified: trunk/squirrelmail/functions/mime.php
===================================================================
--- trunk/squirrelmail/functions/mime.php	2008-01-29 23:23:59 UTC (rev 12902)
+++ trunk/squirrelmail/functions/mime.php	2008-01-29 23:36:14 UTC (rev 12903)
@@ -561,6 +561,9 @@
          * for a more generic type. Finally, a hook for ALL attachment
          * types is run as well.
          */
+        // First remember the default link.
+        $defaultlink_orig = $defaultlink;
+
         /* The API for this hook has changed as of 1.5.2 so that all plugin
            arguments are passed in an array instead of each their own plugin
            argument, and arguments are passed by reference, so instead of
@@ -569,7 +572,7 @@
         $temp = array(&$links, &$startMessage, &$id, &$urlMailbox, &$ent, 
                     &$defaultlink, &$display_filename, &$where, &$what);
         do_hook("attachment $type0/$type1", $temp);
-        if(count($links) <= 1) {
+        if(count($links) <= 1 && $defaultlink == $defaultlink_orig) {
             /* The API for this hook has changed as of 1.5.2 so that all plugin
                arguments are passed in an array instead of each their own plugin
                argument, and arguments are passed by reference, so instead of
@@ -586,6 +589,12 @@
            arguments themselves. */
         $temp = array(&$links, &$startMessage, &$id, &$urlMailbox, &$ent, 
                       &$defaultlink, &$display_filename, &$where, &$what);
+        // Do not let a generic plugin change the default link if a more
+        // specialized one already did it...
+        if ($defaultlink != $defaultlink_orig) {
+            $dummy = '';
+            $temp[5] = &$dummy;
+        }
         do_hook("attachment */*", $temp);
 
         $this_attachment = array();


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic