summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-09-28 18:07:11 +0200
committerSarven Capadisli <csarven@status.net>2009-09-28 18:07:11 +0200
commitf6d67781a10b136a9700d616bfb1d0336211e4e3 (patch)
tree4ed6fee1d7b4cfa0e74dfafdc21e4768628dee9f /lib/util.php
parentc012b278f00664470e74a0009791e8b2bca2a5e3 (diff)
parent4e6c7302072eb6e11ae0025795a7a96fb28f2f29 (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.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;