X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fstrings.php;h=902cdf861616e533b53d7cde826daeba3880ce3e;hp=8d5385b903b130832c5c43ada9f5264c8f88eef7;hb=cf59dc943685843046e66589d855e6824369ac36;hpb=281b6aec146b464e41e0e652534f64e2e55afd88
diff --git a/functions/strings.php b/functions/strings.php
index 8d5385b9..902cdf86 100644
--- a/functions/strings.php
+++ b/functions/strings.php
@@ -1,4 +1,4 @@
-
+.*$", "", $array[$i]);
+ }
return $array;
}
@@ -91,21 +95,24 @@
return $to_line;
}
- function translateText($body, $wrap_at) {
+ 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++) {
$line = $body_ary[$i];
$line = "^^$line";
- $line = str_replace(">", ">", $line);
- $line = str_replace("<", "<", $line);
+ //$line = str_replace(">", ">", $line);
+ //$line = str_replace("<", "<", $line);
+ //$line = htmlspecialchars($line);
if (strlen($line) >= $wrap_at) // -2 because of the ^^ at the beginning
$line = wordWrap($line, $wrap_at);
+ $line = charset_decode($charset, $line);
+
$line = str_replace(" ", " ", $line);
$line = str_replace("\t", " ", $line);
$line = nl2br($line);
@@ -121,6 +128,8 @@
$line = "$line
\n";
}
+ $line = parseEmail ($line);
+ $line = parseUrl ($line);
$new_body[$i] = "$line";
}
$bdy = implode("\n", $new_body);
@@ -128,7 +137,7 @@
}
/* SquirrelMail version number -- DO NOT CHANGE */
- $version = "0.4pre1";
+ $version = "0.5pre1";
function find_mailbox_name ($mailbox) {
@@ -150,20 +159,4 @@
function replace_escaped_spaces ($string) {
return str_replace(" ", " ", $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;
- }
?>