Changed comment. It used to plain wrong.
[squirrelmail.git] / functions / strings.php
index c9c6b9b29b32124d9343b43a6e998331e0f44804..84663b53506dc06c93e07b19e0b3ffbcb4a2ac24 100644 (file)
@@ -1,4 +1,4 @@
-<?
+<?php
 
    $strings_php = true;
 
       return $data;
    }
 
+   // Searches for the next position in a string minus white space
+   function next_pos_minus_white ($haystack, $pos) {
+      while (substr($haystack, $pos, 1) == " " ||
+             substr($haystack, $pos, 1) == "\t" ||
+             substr($haystack, $pos, 1) == "\n" ||
+             substr($haystack, $pos, 1) == "\r") {
+         if ($pos >= strlen($haystack))
+            return -1;
+         $pos++;
+      }        
+      return $pos;        
+   }
+
    // Wraps text at $wrap characters
    function wordWrap($passed, $wrap) {
       $passed = str_replace("&gt;", ">", $passed);
       $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;
    }
 
    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);
 
       for ($i = 0; $i < count($body_ary); $i++) {
    }
 
    /* SquirrelMail version number -- DO NOT CHANGE */
-   $version = "0.4pre1";
+   $version = "0.5pre1";
 
 
    function find_mailbox_name ($mailbox) {