[Svn] r2322 - trunk/roundcubemail/program/steps/mail

trac at roundcube.net trac at roundcube.net
Mon Mar 2 14:21:52 CET 2009


Author: thomasb
Date: 2009-03-02 07:21:52 -0600 (Mon, 02 Mar 2009)
New Revision: 2322

Modified:
   trunk/roundcubemail/program/steps/mail/func.inc
Log:
Add callback for <a> tags to add target=_blank

Modified: trunk/roundcubemail/program/steps/mail/func.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/func.inc	2009-03-01 08:14:14 UTC (rev 2321)
+++ trunk/roundcubemail/program/steps/mail/func.inc	2009-03-02 13:21:52 UTC (rev 2322)
@@ -707,6 +707,7 @@
   }
     
   $washer = new washtml($wash_opts);
+  $washer->add_callback('a', 'rcmail_washtml_callback');
   $washer->add_callback('form', 'rcmail_washtml_callback');
 
   if ($p['safe']) {  // allow CSS styles, will be sanitized by rcmail_washtml_callback()
@@ -819,6 +820,11 @@
       $out = html::div('form', $content);
       break;
       
+    case 'a':
+      if ($attrib) $attrib .= ' target="_blank"';
+      $out = '<a'.$attrib.'>' . $content . '</a>';
+      break;
+      
     case 'style':
       // decode all escaped entities and reduce to ascii strings
       $stripped = preg_replace('/[^a-zA-Z\(:]/', '', rcmail_xss_entitiy_decode($content));

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list