cvs: smarty / NEWS /libs/plugins modifier.escape.php

"Monte Ohrt" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmohrt1083336617@cvsserver>
mohrt		Fri Apr 30 10:50:17 2004 EDT

  Modified files:              
    /smarty	NEWS 
    /smarty/libs/plugins	modifier.escape.php 
  Log:
  add 'mail' attribute to escape modifier
  
  
http://cvs.php.net/diff.php/smarty/NEWS?r1=1.448&r2=1.449&ty=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.448 smarty/NEWS:1.449
--- smarty/NEWS:1.448	Fri Apr 16 06:33:30 2004
+++ smarty/NEWS	Fri Apr 30 10:50:17 2004
@@ -1,3 +1,6 @@
+  - add 'mail' to escape modifier for safe display of e-mail
+    addresses (Monte)
+  - add cycle function attribute "reset" to english docs (Monte)
   - enhanced support of numeric constants as variable-expressions (messju)
   - add case decentity to smarty_modifier_escape() (Konstantin A. Pelepelin,
     messju)
http://cvs.php.net/diff.php/smarty/libs/plugins/modifier.escape.php?r1=1.14&r2=1.15&ty=u
Index: smarty/libs/plugins/modifier.escape.php
diff -u smarty/libs/plugins/modifier.escape.php:1.14 smarty/libs/plugins/modifier.escape.php:1.15
--- smarty/libs/plugins/modifier.escape.php:1.14	Fri Apr 16 04:40:42 2004
+++ smarty/libs/plugins/modifier.escape.php	Fri Apr 30 10:50:17 2004
@@ -59,6 +59,10 @@
         case 'javascript':
             // escape quotes and backslashes and newlines
             return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n'));
+            
+        case 'mail':
+            // safe way to display e-mail address on a web page
+            return str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '),$string);
 
         default:
             return $string;

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.