Fixed parsing of ',', '.', and EOL
authorjdries3 <jdries3@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 26 Nov 2001 16:49:47 +0000 (16:49 +0000)
committerjdries3 <jdries3@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 26 Nov 2001 16:49:47 +0000 (16:49 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1807 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/url_parser.php

index 3e20d76325ece638490bfa36c3519d21ac932575..4a832a2db796aa8cb01b189d86f843f5a3d2ca75 100644 (file)
@@ -77,7 +77,7 @@
    global $url_parser_poss_ends;
    $url_parser_poss_ends = array(' ', "\n", "\r", '<', '>', ".\r", ".\n", 
        '.&nbsp;', '&nbsp;', ')', '(', '&quot;', '&lt;', '&gt;', '.<', 
-       ']', '[', '{', '}', "\240");
+       ']', '[', '{', '}', "\240", ', ', '. ', ",\n", ",\r");
 
 
    function parseUrl (&$body)
           // 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) 
           {