Multiple URLs on one line weren't getting parsed correctly
[squirrelmail.git] / functions / url_parser.php
index 9e35726e915b774565743ecafd09af98fce3778e..82da7973e48c92451ba89861ac4eed6ab74ac095 100644 (file)
@@ -111,7 +111,7 @@ function parseUrl (&$body) {
         /* Find the first token to replace */
         foreach ($url_parser_url_tokens as $the_token) {
             $pos = strpos(strtolower($body), $the_token, $start);
-            if (is_int($pos) && $pos < $blength) {
+            if (is_int($pos) && $pos < $target_pos) {
                 $target_pos   = $pos;
                 $target_token = $the_token;
             }