[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-cvs
Subject:    [SMARTY-CVS] cvs: smarty / NEWS  /libs/plugins modifier.escape.php
From:       "Monte Ohrt" <mohrt () php ! net>
Date:       2004-04-30 14:50:17
Message-ID: cvsmohrt1083336617 () cvsserver
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic