Merge branch 'lookup_url_fix' into 'nightly'
makes url lookup work and adds full url to href for shortened links See merge request !74
This commit is contained in:
commit
956e053da6
|
@ -195,6 +195,7 @@ class File_redirection extends Managed_DataObject
|
|||
|
||||
$redir->httpcode = $redir_info['code'];
|
||||
$redir->redirections = intval($redir_info['redirects']);
|
||||
$redir->redir_url = $redir_info['url'];
|
||||
$redir->file = new File();
|
||||
$redir->file->url = $redir_info['url'];
|
||||
$redir->file->mimetype = $redir_info['type'];
|
||||
|
|
|
@ -80,7 +80,7 @@ class GNUsocial_HTTPResponse extends HTTP_Request2_Response
|
|||
*/
|
||||
function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
return $this->effectiveUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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'));
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user