From 8ceb637a7043efb76fc7028be743da5a32f2a530 Mon Sep 17 00:00:00 2001 From: fidian Date: Mon, 30 Oct 2000 16:48:22 +0000 Subject: [PATCH]
 tags instead of  and   stuff for reading mail.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@825 7612ce4b-ef26-0410-bec9-ea0150e637f0
---
 functions/strings.php | 33 +++++++++++----------------------
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/functions/strings.php b/functions/strings.php
index 06057912..ff4b7c7b 100644
--- a/functions/strings.php
+++ b/functions/strings.php
@@ -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";
          }
@@ -139,6 +140,7 @@
       }
       
       $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) {
@@ -147,22 +149,15 @@
          $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("^ ", " ", $line);
-         $line = str_replace('  ', '  ', $line);
-         $line = str_replace('  ', '  ', $line);
-         $line = nl2br($line);
-
          parseUrl ($line);
          
          $Quotes = 0;
          $pos = 0;
          while (1)
          {
-             if (strpos($line, ' ', $pos) === $pos)
+             if ($line[$pos] == ' ')
              {
-                $pos += 6;
+                $pos ++;
              }
              else if (strpos($line, '>', $pos) === $pos)
              {
@@ -175,20 +170,14 @@
              }
          }
          
-         if ($Quotes > 1) {
-            $line = "$line\n";
-         } else if ($Quotes) {
-            $line = "$line\n";
-         }
-
-         if ($line)
-         {
-             $line = '' . $line . '';
-         }
+         if ($Quotes > 1)
+            $line = "$line";
+         elseif ($Quotes)
+            $line = "$line";
 
-         $body_ary[$i] = $line . '
'; + $body_ary[$i] = $line; } - $body = implode("\n", $body_ary); + $body = "
" . implode("\n", $body_ary) . "
"; } /* SquirrelMail version number -- DO NOT CHANGE */ -- 2.25.1