diff options
author | Brion Vibber <brion@pobox.com> | 2009-10-04 16:16:52 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2009-10-04 16:16:52 -0700 |
commit | 4462a1c63600fa83d2692ac2de8067b12b1eeac9 (patch) | |
tree | a946b98184eb32b5be4bf64e67357c06e8d0f65d /lib/util.php | |
parent | 9235c1437e542d2b565d2d2d36fe2b7561e4d5f7 (diff) | |
parent | 2f065d687dc76bfbac3e1b7b3dcccf544f4b4987 (diff) |
Merge branch '0.9.x' of git://gitorious.org/statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/util.php b/lib/util.php index 56753debe..d249b154f 100644 --- a/lib/util.php +++ b/lib/util.php @@ -522,20 +522,21 @@ function common_linkify($url) { if(strpos($url, '@') !== false && strpos($url, ':') === false) { //url is an email address without the mailto: protocol - return XMLStringer::estring('a', array('href' => "mailto:$url", 'rel' => 'external'), $url); - } + $canon = "mailto:$url"; + $longurl = "mailto:$url"; + }else{ - $canon = File_redirection::_canonUrl($url); + $canon = File_redirection::_canonUrl($url); - $longurl_data = File_redirection::where($url); - if (is_array($longurl_data)) { - $longurl = $longurl_data['url']; - } elseif (is_string($longurl_data)) { - $longurl = $longurl_data; - } else { - throw new ServerException("Can't linkify url '$url'"); + $longurl_data = File_redirection::where($canon); + if (is_array($longurl_data)) { + $longurl = $longurl_data['url']; + } elseif (is_string($longurl_data)) { + $longurl = $longurl_data; + } else { + throw new ServerException("Can't linkify url '$url'"); + } } - $attrs = array('href' => $canon, 'title' => $longurl, 'rel' => 'external'); $is_attachment = false; |