don't over specialize URLs

This commit is contained in:
Evan Prodromou 2009-02-12 09:22:45 -05:00
parent eaae456222
commit ab8d27b8d1

View File

@ -472,13 +472,15 @@ function common_replace_urls_callback($text, $callback) {
}
function common_linkify($url) {
// It comes in special'd, so we unspecial it before passing to the stringifying
// functions
$url = htmlspecialchars_decode($url);
$display = $url;
$url = (!preg_match('#^([a-z]+://|(mailto|aim|tel):)#i', $url)) ? 'http://'.$url : $url;
$attrs = array('href' => $url, 'rel' => 'external');
if ($longurl = common_longurl($url)) {
$longurl = htmlentities($longurl, ENT_QUOTES, 'UTF-8');
$attrs['title'] = $longurl;
}