C´est un peu fais a l´arrche mais ça devrait fonctionner :
$txt = "blabla http://moi.fr et [url=http//osef.com"]osef[/url]";
$txt = str_replace("[url=http", "[url=h_ttp", $txt
);
$txt = preg_replace("`
http://[a-zA-Z0-9._/\\-?=~&;]+`" , "<a href=´$0´ onclick=\"window.open(this.href); return false; \">$0</a>", $txt);
$txt = str_replace("[url=h_ttp", "[url=http", $txt);
$txt = preg_replace("`\[url=(.*)\](.*)\[/url\]`isuU", "<a href=\"$0\" onclick=\"window.open(this.href); return false; \">$1</a>", $txt);
non testé