fixed minor bug in url parsing that didn't let urls be at beginning of line
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 1 Aug 2000 12:49:36 +0000 (12:49 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 1 Aug 2000 12:49:36 +0000 (12:49 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@667 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/url_parser.php

index a34631437f5a71314ff9b969243229bb4639be10..05aca966c2e3567b45cd324689cfa1134b29fdb0 100644 (file)
                          "ftp://",
                          "telnet://");
          for($i = 0; $i < sizeof($url_tokens); $i++) {
-           if($where = strpos(strtolower($body), $url_tokens[$i], $start))
+           if($where = strpos(strtolower("^^".$body), $url_tokens[$i], $start))
              break;
          }
          //$where = strpos(strtolower($body),"http://",$start);
          if ($where) {
+            $where = $where - 2;  // because we added the ^^ at the begining
             # Find the end of that URL
             reset($poss_ends); $end=0; 
             while (list($key, $val) = each($poss_ends)) {