forked from GNUsocial/gnu-social
Notice URIs are not necessarily URLs.
Let's use getUrl() for URL retrieval. May throw exceptions, but only if it's a Notice that cannot be linked like that anyway.
This commit is contained in:
@@ -628,7 +628,7 @@ class Facebookclient
|
||||
|
||||
// Facebook has a 420-char hardcoded max.
|
||||
if (mb_strlen($statustxt) > 420) {
|
||||
$noticeUrl = common_shorten_url($this->notice->uri);
|
||||
$noticeUrl = common_shorten_url($this->notice->getUrl());
|
||||
$urlLen = mb_strlen($noticeUrl);
|
||||
$txt = mb_substr($statustxt, 0, 420 - ($urlLen + 3)) . ' … ' . $noticeUrl;
|
||||
}
|
||||
|
@@ -207,7 +207,7 @@ class LinkbackPlugin extends Plugin
|
||||
$profile->nickname,
|
||||
common_exact_date($this->notice->created)),
|
||||
'excerpt' => $this->notice->content,
|
||||
'url' => $this->notice->uri,
|
||||
'url' => $this->notice->getUrl(),
|
||||
'blog_name' => $profile->nickname);
|
||||
|
||||
$fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
|
||||
|
@@ -1075,7 +1075,7 @@ class OStatusPlugin extends Plugin
|
||||
// TRANS: %1$s is the unfavoring user's name, %2$s is URI to the no longer favored notice.
|
||||
$act->content = sprintf(_m('%1$s no longer likes %2$s.'),
|
||||
$profile->getBestName(),
|
||||
$notice->uri);
|
||||
$notice->getUrl());
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($profile);
|
||||
$act->object = ActivityObject::fromNotice($notice);
|
||||
|
@@ -465,7 +465,7 @@ class QnAPlugin extends MicroAppPlugin
|
||||
$ellipsis = _m('…');
|
||||
$short = mb_substr($content, 0, $max - 1);
|
||||
$short .= sprintf('<a href="%1$s" rel="more" title="%2$s">%3$s</a>',
|
||||
$notice->uri,
|
||||
$notice->getUrl(),
|
||||
// TRANS: Title for link that is an ellipsis in English.
|
||||
_m('more...'),
|
||||
$ellipsis);
|
||||
|
@@ -379,7 +379,7 @@ function format_status($notice)
|
||||
|
||||
// Twitter still has a 140-char hardcoded max.
|
||||
if (mb_strlen($statustxt) > 140) {
|
||||
$noticeUrl = common_shorten_url($notice->uri);
|
||||
$noticeUrl = common_shorten_url($notice->getUrl());
|
||||
$urlLen = mb_strlen($noticeUrl);
|
||||
$statustxt = mb_substr($statustxt, 0, 140 - ($urlLen + 3)) . ' … ' . $noticeUrl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user