Fix what I think was a misunderstanding of what the "extra" attribute was supposed...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Nov 2020 20:17:15 +0000 (20:17 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Nov 2020 20:17:15 +0000 (20:17 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14873 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php
templates/default/read_attachments.tpl

index cafd41c..0e6d106 100644 (file)
@@ -656,12 +656,19 @@ function buildAttachmentArray($message, $exclude_id, $mailbox, $id) {
                 $this_attachment['ViewHREF'] = $val['href'];
                 continue;
             }
-            if (empty($val['text']) && empty($val['extra']))
+
+            // This makes no sense - If 'text' and 'extra' are just concatenated,
+            // there is no point in having 'extra'.... I am going to assume this
+            // was a mistake and am changing 'extra' to be what I think it was
+            // meant to be: additional tag attributes.  However, I'm not checking
+            // extensively for plugins that were using this the wrong way (but why would they?)
+            if (empty($val['text']))
                 continue;
 
             $temp = array();
             $temp['HREF'] = $val['href'];
-            $temp['Text'] = (empty($val['text']) ? '' : $val['text']) . (empty($val['extra']) ? '' : $val['extra']);
+            $temp['Text'] = $val['text'];
+            $temp['Extra'] = (empty($val['extra']) ? '' : $val['extra']);
             $this_attachment['OtherLinks'][] = $temp;
         }
         $attachments[] = $this_attachment;
index 20c015d..80c52e8 100644 (file)
  *    $attachments - array containing info for all message attachments.  Each
  *                   element in the array represents a separate attachment and
  *                   contains the following elements:
- *       $el['Name']         - The name of the attachment
- *       $el['Description']  - Description of the attachment
- *       $el['DefaultHREF']  - URL to the action that should occur when the name is clicked
- *       $el['DownloadHREF'] - URL to download the attachment
- *       $el['ViewHREF']     - URL to view the attachment.  Empty if not available.
- *       $el['Size']         - Size of attachment in bytes.
- *       $el['ContentType']  - Content-Type of the attachment
- *       $el['OtherLinks']   - array containing links to any other actions
- *                             available for this attachment that might be
- *                             provided by plugins, for example.  Each element represents
- *                             a different action and contains the following elements:
- *            $link['HREF'] - URL to access the functionality
- *            $link['Text'] - Text representing the functionality.
+ *       $el['Name']          - The name of the attachment
+ *       $el['Description']   - Description of the attachment
+ *       $el['DefaultHREF']   - URL to the action that should occur when the name is clicked
+ *       $el['DownloadHREF']  - URL to download the attachment
+ *       $el['ViewHREF']      - URL to view the attachment.  Empty if not available.
+ *       $el['Size']          - Size of attachment in bytes.
+ *       $el['ContentType']   - Content-Type of the attachment
+ *       $el['OtherLinks']    - array containing links to any other actions
+ *                              available for this attachment that might be
+ *                              provided by plugins, for example.  Each element represents
+ *                              a different action and contains the following elements:
+ *            $link['HREF']  - URL to access the functionality
+ *            $link['Text']  - Text representing the functionality
+ *            $link['Extra'] - Any extra anchor tag attributes provided by a plugin
  *
  * @copyright 1999-2020 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
@@ -82,7 +83,7 @@ if (count($attachments)==0) {
     foreach ($attachment['OtherLinks'] as $link) {
         ?>
    &nbsp;|&nbsp;
-   <a href="<?php echo $link['HREF']; ?>"><?php echo $link['Text']; ?></a>
+   <a href="<?php echo $link['HREF'] . '" ' . $link['Extra']; ?>><?php echo $link['Text']; ?></a>
         <?php
     }
    ?>