[horde] Notification push with a link

Chuck Hagenbuch chuck at horde.org
Mon Oct 2 08:57:50 PDT 2006


Quoting Laura McCord <mccordl at southwestern.edu>:

> I want to be able to add a link to a notification however using sprintf
> will only write out the string and not actually produce the link as
> printf would. Does anyone have any suggestions?
>
> This is what I am trying to do:
>  $notification->push(sprintf(_('<a href=\"%s\">test</a>'), $url
> ),'horde.success');

This has nothing to do with sprintf vs. printf. You need to tell the  
notification system that you're sending HTML content - and since  
you're doing so, you are responsible for escaping the data in the link  
(to avoid javascript injection, etc.).

You want the third arg to push:
$notification->push($link, 'horde.success', array('content.raw'));

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the horde mailing list