![snakes](https://xoops.org/uploads/cavt433bce6725f82.jpg)
Look at the end:
"\1"
You see that host2 is equal to '' (empty string)
Then href will contain host1+'.'+host2, but host2 is empty so the email will have the '.' at the end.
What we do is to replace that code with:
"\1
"\1"
"\1
$replacements = array("\1\2://\3" target="_blank">\2://\3", "\1http://www.\2.\3", "\1ftp.\2.\3", "\1");
$replacements = array("\1\2://\3" target="_blank">\2://\3", "\1http://www.\2.\3", "\1ftp.\2.\3", "\1");
$patterns = array("/(^|[^]_a-z0-9-="'/])([a-z]+?)://([^rn"()'<>]+)/i",
"/(^|[^]_a-z0-9-="'/])www.([a-z0-9-]+).([^rn"()'<>]+)/i",
"/(^|[^]_a-z0-9-="'/])ftp.([a-z0-9-]+).([^rn"()'<>]+)/i",
"/(^|[^]_a-z0-9-="'/:.])([a-z0-9-_.]+?)@([a-z0-9-_.]+?).([^rn"()'<>[]]+)/i");
$patterns = array("/(^|[^]_a-z0-9-="'/])([a-z]+?)://([^
rn"()'<>]+)/i",
"/(^|[^]_a-z0-9-="'/])www.([a-z0-9-]+).([^
rn"()'<>]+)/i",
"/(^|[^]_a-z0-9-="'/])ftp.([a-z0-9-]+).([^
rn"()'<>]+)/i",
"/(^|[^]_a-z0-9-="'/:.])([a-z0-9-_.]+?)@([^rn"()'<>[]]+)/i");
$patterns = array(
"/(^|[^]_a-z0-9-="'/])([a-z]+?)://([^, rn"()'<>]+)/i",
"/(^|[^]_a-z0-9-="'/])www.([a-z0-9-]+).([^, rn"()'<>]+)/i",
"/(^|[^]_a-z0-9-="'/])ftp.([a-z0-9-]+).([^, rn"()'<>]+)/i",
"/(^|[^]_a-z0-9-="'/:.])([a-z0-9-_.]+?)@([a-z0-9-_.]+?).([^, rn"()'<>[]]+)/i"
);
$patterns = array("/(^|[^]_a-z0-9-="'/])([a-z]+?)://([^, rn"()'<>]+)/i", "/(^|[^]_a-z0-9-="'/])www.([a-z0-9-]+).([^, rn"()'<>]+)/i", "/(^|[^]_a-z0-9-="'/])ftp.([a-z0-9-]+).([^, rn"()'<>]+)/i", "/(^|[^]_a-z0-9-="'/:.])([a-z0-9-_.]+?)@([^, rn"()'<>[]]+)/i");
<script language="javascript">
function snx_hardlink(link, redirect) {
link.href='<{$xoops_url}>' + redirect;
return true;
}
script>
$ImagePartner = ".$array_partners[$i]["id"]."' target='_blank'>";
$ImagePartner = "{$array_partners[$i]['url']}' onMouseDown='snx_hardlink(this, "/modules/xoopspartners/vpartner.php?id=".$array_partners[$i]["id"]."")' target='_blank'>";
<a href="<{$xoops_url}>/modules/xoopspartners/vpartner.php?id=<{$partner.id}>" target="_blank">
<a href="<{$partner.url}>" onMouseDown="snx_hardlink(this, '/modules/xoopspartners/vpartner.php?id=<{$partner.id}>')" target="_blank">
<a href="[A HARD LINK URL]" onMouseDown="snx_hardlink(this, '/path/to/redir_script.php?id=[partnerID]')">[TEXT]a>
http://www.mysite.com/modules/myMod/index/65/xoops-is-cool
instead of
http://www.mysite.com/modules/myMod/index.php?newsid=65&msg=xoops-is-cool