Diff for /cdn/www/annotate.html between versions 1.10 and 1.11

version 1.10, 2003/03/23 17:53:10 version 1.11, 2003/03/23 17:55:33
Line 1 Line 1
 <?php  <?php
   
$author = 'tsetse@chrisneale.co.uk';$author = 'cdn@mozdev.org';
 $post_to_list = 0;  $post_to_list = 0;
   
 // $Id$  // $Id$
Line 8  $post_to_list = 0; Line 8  $post_to_list = 0;
 function cleanse ($message, $name = false) {  function cleanse ($message, $name = false) {
   
 // censor before sending to author/NG  // censor before sending to author/NG
   
    if ( ! $name )     if ( ! $name )
    {     {
      $message = str_replace("\r\n", "[r[n ", $message); // kludge around       $message = str_replace("\r\n", "[r[n ", $message); // kludge around
    }     }
   
    $message = ' ' . $message;     $message = ' ' . $message;
    $replacements = array('"', "'", '*', '#', '&', '$', '', '?', '%', '@', '+', 'X', 'x', );     $replacements = array('"', "'", '*', '#', '&', '$', '', '?', '%', '@', '+', 'X', 'x', );
    srand ((float)microtime()*1000000);     srand ((float)microtime()*1000000);
    shuffle($replacements);     shuffle($replacements);
   
    $cursed = array("m[0ou]th[3e]r[\ ]?f[cu]+[c]?k[3e]r",     $cursed = array("m[0ou]th[3e]r[\ ]?f[cu]+[c]?k[3e]r",
                    "f[\ \.]*[cu]+[\ \.]*[c]?[\ \.]*k",                     "f[\ \.]*[cu]+[\ \.]*[c]?[\ \.]*k",
                    "[4a]+[5s$]+[5s$]hole",                     "[4a]+[5s$]+[5s$]hole",
Line 36  function cleanse ($message, $name = fals Line 36  function cleanse ($message, $name = fals
   
   for ($i=0; $cursed[$i] != ''; $i++) {    for ($i=0; $cursed[$i] != ''; $i++) {
     // whitespace, however currently turns '\n' to ' '      // whitespace, however currently turns '\n' to ' '
    $cursed[$i] = '[\ ]+' . $cursed[$i];     $cursed[$i] = '[\ ]+' . $cursed[$i];
     shuffle($replacements);      shuffle($replacements);
    $repstring = $replacements[0] . $replacements[2] . $replacements[5] .     $repstring = $replacements[0] . $replacements[2] . $replacements[5] .
                  $replacements[1] . $replacements[3];                   $replacements[1] . $replacements[3];
   
     if ($i == 0)      if ($i == 0)
Line 60  function cleanse ($message, $name = fals Line 60  function cleanse ($message, $name = fals
     $message = str_replace("[r[n ", "\r\n", $message); // losing \r\n to [\ ] or [[:space:]]      $message = str_replace("[r[n ", "\r\n", $message); // losing \r\n to [\ ] or [[:space:]]
   
   }    }
  
   return $message;    return $message;
   
 }  }
Line 90  function findBugs($text) Line 90  function findBugs($text)
   
 function slash($_page)  function slash($_page)
 {  {
  
// if no leading slash - add one  // if no leading slash - add one
   
   if ( !ereg('^/', $_page) )    if ( !ereg('^/', $_page) )
   {    {
Line 128  function findLinks($text) Line 128  function findLinks($text)
   
 // find and 'linkify' links  // find and 'linkify' links
   
  $text    = eregi_replace("((http|https|ftp):\/\/[^[:space:]<>]{1,})",   $text    = eregi_replace("((http|https|ftp):\/\/[^[:space:]<>]{1,})",
                            "<a href=\"\\1\">\\1</a>",$text);                             "<a href=\"\\1\">\\1</a>",$text);
 /*  /*
   
Line 140  $regExp = "^[\+\&_\.0-9a-z-]+@([0-9a-z]+ Line 140  $regExp = "^[\+\&_\.0-9a-z-]+@([0-9a-z]+
   
 */  */
   
  $text    = eregi_replace("(mailto:[^[:space:]<>]{1,})",   $text    = eregi_replace("(mailto:[^[:space:]<>]{1,})",
                            "<a href=\"\\1\">\\1</a>",$text);                             "<a href=\"\\1\">\\1</a>",$text);
   
 // tidy email references  // tidy email references
   $text = str_replace('>mailto:', '>', $text);    $text = str_replace('>mailto:', '>', $text);
  
   return $text;    return $text;
   
 }  }
Line 154  $regExp = "^[\+\&_\.0-9a-z-]+@([0-9a-z]+ Line 154  $regExp = "^[\+\&_\.0-9a-z-]+@([0-9a-z]+
 function htmlise($text)  function htmlise($text)
 {  {
   
  $text = htmlspecialchars(str_replace("\\", "", $text));    $text = htmlspecialchars(str_replace("\\", "", $text));
   
   $text = findLinks($text);    $text = findLinks($text);
   
Line 165  function htmlise($text) Line 165  function htmlise($text)
   $text = ereg_replace("\r\n\r\n", "\n<p/>", $text);    $text = ereg_replace("\r\n\r\n", "\n<p/>", $text);
   
   $text = ereg_replace("\r\n", "\n<br/>", $text);    $text = ereg_replace("\r\n", "\n<br/>", $text);
  
   
   return $text;    return $text;
 }  }
  
 ?><!-- ********************* START NOTES ******************** -->  ?><!-- ********************* START NOTES ******************** -->
   
 <div id="NOTESheader"><a name="NOTES"><strong>User Notes:</strong></a> <a href="http://<?php echo HOST; ?>/docs/notes.html">[?]</a></div>  <div id="NOTESheader"><a name="NOTES"><strong>User Notes:</strong></a> <a href="http://<?php echo HOST; ?>/docs/notes.html">[?]</a></div>
Line 177  function htmlise($text) Line 177  function htmlise($text)
 <div id="NOTESnotes"><acronym class="cdn" title="HyperText Markup Language">HTML</acronym> is not allowed in posts.<br/>  <div id="NOTESnotes"><acronym class="cdn" title="HyperText Markup Language">HTML</acronym> is not allowed in posts.<br/>
 <acronym class="cdn" title="Uniform Resource Locator">URL</acronym>s in the text that use mailto:, https://, http:// and ftp:// will be converted into hyperlinks.</div>  <acronym class="cdn" title="Uniform Resource Locator">URL</acronym>s in the text that use mailto:, https://, http:// and ftp:// will be converted into hyperlinks.</div>
   
<p id="NOTESdisclaimer">If you do not get a response to a question posted in this forum, please try sending a message to the project's <a href="http://www.<?php echo HOST; ?>/mailman/listinfo/<?php echo PROJECT_DIR; <p id="NOTESdisclaimer">If you do not get a response to a question posted in this forum, please try sending a message to the project's <a href="http://www.<?php echo HOST; ?>/mailman/listinfo/<?php echo PROJECT_DIR;
 ?>">mailing list</a> or to the <a href="http://www.<?php echo HOST; ?>/contact.html">project owner</a> directly.</p>  ?>">mailing list</a> or to the <a href="http://www.<?php echo HOST; ?>/contact.html">project owner</a> directly.</p>
   
 <p />  <p />
Line 239  if ( $_POST['message'] && $_POST['name'] Line 239  if ( $_POST['message'] && $_POST['name']
         // -- /make link to this comment          // -- /make link to this comment
   
   
           if (isset($author))
             $message .= '[' . base64_decode($author) . ']';
   
         if ( $post_to_list )          if ( $post_to_list )
         {          {
           $mailto = $project . '@' . HOST;            $mailto = $project . '@' . HOST;

Removed from v.1.10  
changed lines
  Added in v.1.11


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>