Merge branch 'nightly' of git.gnu.io:gnu/gnu-social into mmn_fixes
This commit is contained in:
commit
31c8416a8f
@ -195,6 +195,7 @@ class File_redirection extends Managed_DataObject
|
|||||||
|
|
||||||
$redir->httpcode = $redir_info['code'];
|
$redir->httpcode = $redir_info['code'];
|
||||||
$redir->redirections = intval($redir_info['redirects']);
|
$redir->redirections = intval($redir_info['redirects']);
|
||||||
|
$redir->redir_url = $redir_info['url'];
|
||||||
$redir->file = new File();
|
$redir->file = new File();
|
||||||
$redir->file->url = $redir_info['url'];
|
$redir->file->url = $redir_info['url'];
|
||||||
$redir->file->mimetype = $redir_info['type'];
|
$redir->file->mimetype = $redir_info['type'];
|
||||||
@ -396,4 +397,4 @@ class File_redirection extends Managed_DataObject
|
|||||||
|
|
||||||
return $this->file;
|
return $this->file;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -80,7 +80,7 @@ class GNUsocial_HTTPResponse extends HTTP_Request2_Response
|
|||||||
*/
|
*/
|
||||||
function getUrl()
|
function getUrl()
|
||||||
{
|
{
|
||||||
return $this->url;
|
return $this->effectiveUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -360,4 +360,4 @@ class HTTPClient extends HTTP_Request2
|
|||||||
} while ($maxRedirs);
|
} while ($maxRedirs);
|
||||||
return new GNUsocial_HTTPResponse($response, $this->getUrl(), $redirs);
|
return new GNUsocial_HTTPResponse($response, $this->getUrl(), $redirs);
|
||||||
}
|
}
|
||||||
}
|
}
|
14
lib/util.php
14
lib/util.php
@ -980,10 +980,16 @@ function common_linkify($url) {
|
|||||||
} else {
|
} else {
|
||||||
$canon = File_redirection::_canonUrl($url);
|
$canon = File_redirection::_canonUrl($url);
|
||||||
$longurl_data = File_redirection::where($canon, common_config('attachments', 'process_links'));
|
$longurl_data = File_redirection::where($canon, common_config('attachments', 'process_links'));
|
||||||
$longurl = $longurl_data->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;
|
$is_attachment = false;
|
||||||
$attachment_id = null;
|
$attachment_id = null;
|
||||||
@ -2430,4 +2436,4 @@ function html_sprintf()
|
|||||||
$args[$i] = htmlspecialchars($args[$i]);
|
$args[$i] = htmlspecialchars($args[$i]);
|
||||||
}
|
}
|
||||||
return call_user_func_array('sprintf', $args);
|
return call_user_func_array('sprintf', $args);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user