浏览代码

Fix broken subject line that I doubt has worked since we went rg=0

Erin Schnabel 22 年之前
父节点
当前提交
beb60c29b8
共有 2 个文件被更改,包括 19 次插入1 次删除
  1. 1 1
      functions/mailbox_display.php
  2. 18 0
      functions/plugin.php

+ 1 - 1
functions/mailbox_display.php

@@ -182,7 +182,7 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
                 $td_str .= '<a href="read_body.php?mailbox='.$urlMailbox
                         .  '&amp;passed_id='. $msg["ID"]
                         .  '&amp;startMessage='.$start_msg.$searchstr.'"';
-                do_hook("subject_link");
+                $td_str .= ' ' .concat_hook_function('subject_link');
                 if ($subject != $msg['SUBJECT']) {
                     $title = get_html_translation_table(HTML_SPECIALCHARS);
                     $title = array_flip($title);

+ 18 - 0
functions/plugin.php

@@ -68,7 +68,25 @@ function do_hook_function($name,$parm=NULL) {
     return $ret;
 }
 
+/* This function executes a hook. */
+function concat_hook_function($name,$parm=NULL) {
+    global $squirrelmail_plugin_hooks;
+    $ret = '';
 
+    if (isset($squirrelmail_plugin_hooks[$name])
+          && is_array($squirrelmail_plugin_hooks[$name])) {
+        foreach ($squirrelmail_plugin_hooks[$name] as $function) {
+            /* Concatenate results from hook. */
+            if (function_exists($function)) {
+                $ret .= $function($parm);
+            }
+        }
+    }
+
+    /* Variable-length argument lists have a slight problem when */
+    /* passing values by reference. Pity. This is a workaround.  */
+    return $ret;
+}
 
 /**
  * This function checks whether the user's USER_AGENT is known to