1
Very quick and dirty fix for people who do things like
http://oh_my_god_this_is_a_long_url_that_will_screw_up_all_your_pretty_layouts.com/youuknow/you/hate/this/to?and=annoying
So, here is the quick fix:
file: /class/module.textsanitizer.php
version: 2.0.5.x
method: replace function &makeClickable(&$text)
function &makeClickable(&$text)
{
$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");
$replacements = array("\1<a href="\2://\3" target="_blank">\2://\3</a>", "\1<a href="http://www.\2.\3" target="_blank">www.\2.\3</a>", "\1<a href="ftp://ftp.\2.\3" target="_blank">ftp.\2.\3</a>", "\1<a href="mailto:\2@\3">\2@\3</a>");
[b]$string = preg_replace($patterns, $replacements, $text);
$wrap_at = 60;
$string = preg_replace('%(s*)([^>]{'.$wrap_at.',})(<|$)%e',
"'\1'.wordwrap('\2', '".$wrap_at."', '<br />', 1).'\3'", $string);
return $string;[/b]
}