More accurate mailto replacements
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 15 Mar 2005 06:03:11 +0000 (06:03 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 15 Mar 2005 06:03:11 +0000 (06:03 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9029 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/url_parser.php

index c9dbcc53c92676c2b85abdb4a6169c8e6f826c58..2a6da6670a431306baef4f3ef36cba60abbd322b 100644 (file)
@@ -157,7 +157,7 @@ function parseUrl (&$body) {
                             $mailto_params .= '?' . $to;
                     }
                 }
-                $url_str = str_replace(array('to=', 'cc=', 'bcc='), array('send_to=', 'send_to_cc=', 'send_to_bcc='), $mailto_params);
+                $url_str = preg_replace(array('/to=/i', '/(?<!b)cc=/i', '/bcc=/i'), array('send_to=', 'send_to_cc=', 'send_to_bcc='), $mailto_params);
                 $comp_uri = makeComposeLink('src/compose.php' . $url_str, $mailto_before);
                 replaceBlock($body, $comp_uri, $target_pos - 7, $target_pos + strlen($regs[0]));
                 $target_pos += strlen($comp_uri) - 7;
@@ -223,4 +223,4 @@ function getEmail($string) {
     return (array_key_exists(0, $addresses) ? $addresses[0] : '');
 }
 
-?>
\ No newline at end of file
+?>