Fix broken subject line that I doubt has worked since we went rg=0
authorebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 27 Feb 2003 03:23:21 +0000 (03:23 +0000)
committerebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 27 Feb 2003 03:23:21 +0000 (03:23 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4555 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php
functions/plugin.php

index 05162a9..1d04af2 100644 (file)
@@ -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.'"';
                 $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);
                 if ($subject != $msg['SUBJECT']) {
                     $title = get_html_translation_table(HTML_SPECIALCHARS);
                     $title = array_flip($title);
index 6277906..e99b7fe 100644 (file)
@@ -68,7 +68,25 @@ function do_hook_function($name,$parm=NULL) {
     return $ret;
 }
 
     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
 
 /**
  * This function checks whether the user's USER_AGENT is known to