From 43fcef5c49311c3bfbdfbf7706600e2662423643 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Wed, 5 Apr 2000 14:30:54 +0000 Subject: [PATCH] added url parsing stuff git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@388 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 3 ++- functions/strings.php | 2 ++ functions/url_parser.php | 49 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 functions/url_parser.php diff --git a/ChangeLog b/ChangeLog index 4d6b5c38..d099ec55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ Version 0.4pre1 -- Development ------------------------------ -- Added option to configure default folder directory. ex: ~/mail +- Parsing the body for URLs and translating them to links +- Added option to configure default folder directory. ie: ~/mail - Configuration script added: config/conf.pl - Addressbook with LDAP support - Big speed improvements with folder listing diff --git a/functions/strings.php b/functions/strings.php index 44f1d122..44158c56 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -92,6 +92,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); @@ -124,6 +125,7 @@ $line = "$line
\n"; } + $line = parseUrl ($line); $new_body[$i] = "$line"; } $bdy = implode("\n", $new_body); diff --git a/functions/url_parser.php b/functions/url_parser.php new file mode 100644 index 00000000..0a64d65c --- /dev/null +++ b/functions/url_parser.php @@ -0,0 +1,49 @@ +$url"; + # $body = str_replace($url,$url_str,$body); + $body = replaceBlock($body,$url_str,$where,$end); + $start = strpos($body,"",$where); + } else { + $start = $where + 7; + } + } else { + $done=true; + } + } + + return $body; + } + +?> + -- 2.25.1