<pre> tags instead of <tt> and &nbsp; stuff for reading mail.
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 30 Oct 2000 16:48:22 +0000 (16:48 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 30 Oct 2000 16:48:22 +0000 (16:48 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@825 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/strings.php

index 06057912cb8bb5fbdd2628dedc98c1bb00f7bed7..ff4b7c7b93b18eebb53edfdf2d14a6e167e78489 100644 (file)
@@ -64,7 +64,8 @@
          while (!$words[$i] && $i < count($words)) {
             $i ++;
          }
-            
+
+         // Go to the next line if we have more to process            
          if ($i < count($words)) {
             $line .= "\n$beginning_spaces";
          }
       }
       
       $body_ary = explode("\n", $body);
+      $PriorQuotes = 0;
       for ($i=0; $i < count($body_ary); $i++) {
          $line = $body_ary[$i];
          if (strlen($line) - 2 >= $wrap_at) {
          $line = charset_decode($charset, $line);
          $line = str_replace("\t", '        ', $line);
          
-         // We need to do it twice to catch times where there
-         // are an odd number of spaces
-         $line = ereg_replace("^ ", "&nbsp;", $line);
-         $line = str_replace('  ', '&nbsp; ', $line);
-         $line = str_replace('  ', '&nbsp; ', $line);
-         $line = nl2br($line);
-
          parseUrl ($line);
          
          $Quotes = 0;
          $pos = 0;
          while (1)
          {
-             if (strpos($line, '&nbsp;', $pos) === $pos)
+             if ($line[$pos] == ' ')
              {
-                $pos += 6;
+                $pos ++;
              }
              else if (strpos($line, '&gt;', $pos) === $pos)
              {
              }
          }
          
-         if ($Quotes > 1) {
-            $line = "<FONT COLOR=FF0000>$line</FONT>\n";
-         } else if ($Quotes) {
-            $line = "<FONT COLOR=800000>$line</FONT>\n";
-         }
-
-         if ($line)
-         {
-             $line = '<tt>' . $line . '</tt>';
-         }
+         if ($Quotes > 1)
+            $line = "<FONT COLOR=FF0000>$line</FONT>";
+         elseif ($Quotes)
+            $line = "<FONT COLOR=800000>$line</FONT>";
 
-         $body_ary[$i] = $line . '<br>';
+         $body_ary[$i] = $line;
       }
-      $body = implode("\n", $body_ary);
+      $body = "<pre>" . implode("\n", $body_ary) . "</pre>";
    }
 
    /* SquirrelMail version number -- DO NOT CHANGE */