Added MUCH better composing
[squirrelmail.git] / functions / mailbox.php
index 44ea499de34d6f33af0f8cc70fba90cb7691e57c..f3ea7dbcf7bbdbe38e8681b204047d7f0de95163 100644 (file)
       $wrap_at = 80; // Make this configurable int the config file some time
       if (strlen($line) - 2 >= $wrap_at) // -2 because of the ^^ at the beginning
          $line = wordWrap($line, $wrap_at);
+
       $line = str_replace(" ", " ", $line);
       $line = str_replace("\t", "        ", $line);
 
           "www" and "mailto" also.  That should probably be added later. **/
       if (strpos(strtolower($line), "http://") != false) {
          $start = strpos(strtolower($line), "http://");
-         $link = substr($line, $start, strlen($line));
+         $text = substr($line, $start, strlen($line));
+         $link = ereg_replace("<BR>", "", $text);
 
          if (strpos($link, "&"))
             $end = strpos($link, "&");
             $end = strlen($link);
 
          $link = substr($link, 0, $end);
-
-         $line = str_replace($link, "<A HREF=\"$link\" TARGET=_top>$link</A>", $line);
+         $line = str_replace($text, "<A HREF=\"$link\" TARGET=_top>$text</A>", $line);
       }
 
       return $line;