summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-09-27 21:15:14 -0400
committerEvan Prodromou <evan@status.net>2009-09-27 21:15:14 -0400
commit3afcdc18f7bfd23ac780b9f27c47582c1b41bb83 (patch)
tree289e54a747c8b67d5455e85d64045aa7dfb1d54b /lib
parentee9856c452a7e54994c30cd9138dd6faa2107001 (diff)
parentfc2426d7ce33bba0e1ad4dfc1ed9af7749695b20 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php23
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;