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 05162a90d2e4e4c5e5e02a97720163728e3a03fc..1d04af2a25e5f21a5785eb9a11c43c55058c43f6 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.'"';
-                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);
index 6277906dd92c35838b79cf9b24c7efa90a822507..e99b7fefbcc59544260b0fd45c6b59b472b2580a 100644 (file)
@@ -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