/[health_html]/inc/global.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /inc/global.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by ravilov, Tue Oct 2 16:18:09 2001 UTC revision 1.16 by ravilov, Fri Oct 5 15:10:52 2001 UTC
# Line 45  Line 45 
45                  return $str;                  return $str;
46          }          }
47    
48          function MyEscape($str, $full = true) {          function MyEscape($str, $full = false) {
49                    if ($full) {
50                            $str = str_replace("&", "&", $str);
51                            $str = str_replace("<", "&lt;", $str);
52                            $str = str_replace(">", "&gt;", $str);
53                    }
54                  $allowed = array("", "A", "B", "I", "U", "UL", "OL", "LI", "TABLE", "TR", "TH", "TD", "HR", "SUP", "SUB");                  $allowed = array("", "A", "B", "I", "U", "UL", "OL", "LI", "TABLE", "TR", "TH", "TD", "HR", "SUP", "SUB");
55                  $str = preg_replace('/(^[       ]+|[    ]+$)/m', '', $str);                  $str = preg_replace('/(^[       ]+|[    ]+$)/m', '', $str);
56                  $str = preg_replace('/(\<\/?\s*(\w+)\\b[^\>]*\>)/e', 'array_search(MyUpper("\2"),'.                  $str = preg_replace('/(\<\/?\s*(\w+)\\b[^\>]*\>)/e', 'array_search(MyUpper("\2"),'.
57                          '\$allowed,false)?"\1":HTMLSpecialChars("\1")', $str);                          '\$allowed,false)?"\1":HTMLSpecialChars("\1")', $str);
58                  $str = preg_replace('/(\<\s*A\b)/i', '\\1 target=_blank class=more', $str);                  $str = preg_replace('/(\<\s*A\b)/i', '\\1 target=_blank class=more', $str);
59                    $str = preg_replace('/(target=_blank class=[^   ]+)( target=_blank class=[^     ]+)+/', '\\1', $str);
60                  $str = preg_replace('/(\<\s*TABLE\b)/i', '\\1 class=normal', $str);                  $str = preg_replace('/(\<\s*TABLE\b)/i', '\\1 class=normal', $str);
61                  $str = preg_replace('/(class=[^         ]+)( class=[^   ]+)+/', '\\1', $str);                  $str = preg_replace('/(class=[^         ]+)( class=[^   ]+)+/', '\\1', $str);
62                  $str = my_replace($str, "<TABLE", "/TABLE>");                  $str = my_replace($str, "<TABLE", "/TABLE>");

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.26