From 2b3db0f202d1c5c636dc661a87dde6be272c1b61 Mon Sep 17 00:00:00 2001 From: oricn Date: Thu, 8 Jun 2000 18:34:22 +0000 Subject: [PATCH] Added th patch from Tom Duffey, added checking for ftp, telnet, https will lookinto better ways. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@535 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/url_parser.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/functions/url_parser.php b/functions/url_parser.php index 676c9f1a..5b285391 100644 --- a/functions/url_parser.php +++ b/functions/url_parser.php @@ -22,7 +22,16 @@ $done=False; while (!$done) { #Look for when a URL starts - $where = strpos(strtolower($body),"http://",$start); + $url_tokens = array( + "http://", + "https://", + "ftp://", + "telnet://"); + for($i = 0; $i < sizeof($url_tokens); $i++) { + if($where = strpos(strtolower($body), $url_tokens[$i], $start)) + break; + } + //$where = strpos(strtolower($body),"http://",$start); if ($where) { # Find the end of that URL reset($poss_ends); $end=0; -- 2.25.1