[horde] imp's new trailer hook

Michael M Slusarz slusarz at horde.org
Sat Aug 31 04:54:34 UTC 2013


Quoting Gary <witscher at gmail.com>:

> I've been playing with the new parameters for the trailer hook in  
> imp. I get a value for the $to variable but not for the $identity  
> variable. I'm not much good at php, can anyone help me figure this  
> out?

$identity is an object, not a string:

>      * @param IMP_Prefs_Identity $identity  The identity object of  
> the sender.

[snip]

So this isn't going to output anything:

>     "This message was sent by: " . $identity . "\n" .

Since $identity doesn't have an automatic string representation.

Object documentation can be found here:  
http://dev.horde.org/api/master/app/imp/classes/Imp_Prefs_Identity.html

Just a note: your code opens up a fairly substantial security hole if  
adding a trailer to an HTML message, since your current code does not  
escape any harmful content that you may be inserting into the message.  
  So you need to look out for that.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the horde mailing list