From 1b3324b324e79224c9c033ab6e89ed89f3435a21 Mon Sep 17 00:00:00 2001 From: jdries3 Date: Mon, 26 Nov 2001 16:49:47 +0000 Subject: [PATCH] Fixed parsing of ',', '.', and EOL git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1807 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/url_parser.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/functions/url_parser.php b/functions/url_parser.php index 3e20d763..4a832a2d 100644 --- a/functions/url_parser.php +++ b/functions/url_parser.php @@ -77,7 +77,7 @@ global $url_parser_poss_ends; $url_parser_poss_ends = array(' ', "\n", "\r", '<', '>', ".\r", ".\n", '. ', ' ', ')', '(', '"', '<', '>', '.<', - ']', '[', '{', '}', "\240"); + ']', '[', '{', '}', "\240", ', ', '. ', ",\n", ",\r"); function parseUrl (&$body) @@ -125,6 +125,12 @@ // Extract URL $url = substr($body, $target_pos, $end-$target_pos); + // Needed since lines are not passed with \n or \r + while ( ereg("[,\.]$", $url) ) { + $url = substr( $url, 0, -1 ); + $end--; + } + // Replace URL with HyperLinked Url, requires 1 char in link if ($url != '' && $url != $target_token) { -- 2.25.1