X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Furl_parser.php;h=471a84e6fb345d4bb1cffd79fe06135ac3ed64ad;hb=5c920668d71d6d2c89ddb35cbb57713c67141e3b;hp=2fb2d3a67450725354f0384b08b6023a9fea1257;hpb=f435778e5dabea883d6394d5ab43ae72d51dfd50;p=squirrelmail.git diff --git a/functions/url_parser.php b/functions/url_parser.php index 2fb2d3a6..471a84e6 100644 --- a/functions/url_parser.php +++ b/functions/url_parser.php @@ -1,16 +1,38 @@ ', ".\r", ".\n", '. ', ' ', ')', '(', '"', '<', '>', '.<', - ']', '[', '{', '}', "\240"); + ']', '[', '{', '}', "\240", ', ', '. ', ",\n", ",\r"); function parseUrl (&$body) @@ -119,6 +141,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) {