]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
longurl in href
authorhannes <h@nnesmannerhe.im>
Tue, 5 Jan 2016 23:14:51 +0000 (23:14 +0000)
committerhannes <h@nnesmannerhe.im>
Tue, 5 Jan 2016 23:14:51 +0000 (23:14 +0000)
lib/util.php

index c03775f5776f43ee87fb35f762181cec1c071483..fd903d5505a2db28a60f5f277489742516236b93 100644 (file)
@@ -980,10 +980,16 @@ function common_linkify($url) {
     } else {
         $canon = File_redirection::_canonUrl($url);
         $longurl_data = File_redirection::where($canon, common_config('attachments', 'process_links'));
-        $longurl = $longurl_data->redir_url;
+        
+        if(isset($longurl_data->redir_url)) {
+                       $longurl = $longurl_data->redir_url;
+        } else {
+            // e.g. local files
+               $longurl = $longurl_data->url;
+        }
     }
-
-    $attrs = array('href' => $canon, 'title' => $longurl);
+    
+    $attrs = array('href' => $longurl, 'title' => $longurl);
 
     $is_attachment = false;
     $attachment_id = null;