Fixed a glich that caused the 'Viewing message' line to show a strange colour when...
[squirrelmail.git] / functions / strings.php
index c0f23a853f42fb29afe17ec6ff95bc25fe075f4e..dc85a717e560914f0cda4e36a6d6401598eb125c 100644 (file)
@@ -1,4 +1,4 @@
-<?
+<?php
 
    $strings_php = true;
 
       $text = str_replace(" ", "", $text);
       $text = str_replace(",", ";", $text);
       $array = explode(";", $text);
+               for ($i = 0; $i < count ($array); $i++) {
+                       $array[$i] = eregi_replace ("^.*\<", "", $array[$i]);
+                       $array[$i] = eregi_replace ("\>.*$", "", $array[$i]);
+               }
       return $array;
    }
 
@@ -92,6 +96,7 @@
    }
 
    function translateText($body, $wrap_at, $charset) {
+      include ("../functions/url_parser.php");
       /** Add any parsing you want to in here */
       $body = trim($body);
       $body_ary = explode("\n", $body);
             $line = "<TT><FONT COLOR=000000>$line</FONT></TT><BR>\n";
          }
 
+         $line = parseEmail ($line);
+         $line = parseUrl ($line);
          $new_body[$i] = "$line";
       }
       $bdy = implode("\n", $new_body);
    function replace_escaped_spaces ($string) {
       return str_replace("&nbsp;", " ", $string);
    }
-
-   function count_chars($string) {
-      for ($i = 0; $i < strlen($string); $i++) {
-         $ch = substr($string, $i, 1);
-         $size++;
-         if ($ch == "\\") {
-            $i++;   
-            $ch = substr($string, $i, 1);
-            if ($ch == "n")
-               $i--;
-            if ($ch == "r")
-               $i--;
-         }   
-      }   
-      return $size;
-   }
 ?>