]> andersk Git - sql-web.git/commitdiff
encode sql email printout
authorJoe Presbrey <presbrey@mit.edu>
Wed, 12 Apr 2006 02:22:03 +0000 (02:22 +0000)
committerJoe Presbrey <presbrey@mit.edu>
Wed, 12 Apr 2006 02:22:03 +0000 (02:22 +0000)
git-svn-id: svn://presbrey.mit.edu/sql/mitsql@102 a142d4bd-2cfb-0310-9673-cb33a7e74f58

tpl/head.php

index 39176ba56b0c6689f90b17063a6d127589becd9d..8b17dae7293c88f7385ba6cd8c8bc18a2fdb33ed 100644 (file)
@@ -1,5 +1,16 @@
 <?php\r
 \r
+function chars_encode($string) {\r
+   $chars = array();\r
+   $ent = null;\r
+   $chars = preg_split("//", $string, -1, PREG_SPLIT_NO_EMPTY);\r
+   for ($i = 0; $i < count($chars); $i++)\r
+               $ent[$i] = "&#" . ord($chars[$i]) . ";";\r
+   if (sizeof($ent) < 1)\r
+     return "";\r
+   return implode("",$ent);\r
+}\r
+\r
 if (isOffline()) {\r
        switch(THIS_PAGE) {\r
                case 'do/contact':\r
@@ -29,7 +40,7 @@ if (isOffline()) {
                        <div id="masthead">\r
                                <h1 id="header"><a href="http://sql.mit.edu/">sql.mit.edu</a></h1>\r
                                <h2 id="tagline">MIT SIPB MySQL Service for Athena<br />\r
-                                       email: <? echo htmlentities('sql@mit.edu'); ?></h2>\r
+                                       email: <?=chars_encode('sql@mit.edu')?></h2>\r
                        </div>\r
                        <div id="hmenu">\r
                                <?php isOnline() && include('menu.php'); ?>\r
This page took 0.17429 seconds and 5 git commands to generate.