mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-22 14:43:41 +00:00
Merge pull request #693 from MrPetovan/bug/4708-twitter-keep-display-urls
[twitter] Keep original display URL after link expansion
This commit is contained in:
commit
52981604d3
1 changed files with 3 additions and 3 deletions
|
@ -1169,7 +1169,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
|
||||||
//$dontincludemedia = true;
|
//$dontincludemedia = true;
|
||||||
$type = $oembed_data->type;
|
$type = $oembed_data->type;
|
||||||
$footerurl = $expanded_url;
|
$footerurl = $expanded_url;
|
||||||
$footerlink = "[url=" . $expanded_url . "]" . $expanded_url . "[/url]";
|
$footerlink = "[url=" . $expanded_url . "]" . $url->display_url . "[/url]";
|
||||||
|
|
||||||
$body = str_replace($url->url, $footerlink, $body);
|
$body = str_replace($url->url, $footerlink, $body);
|
||||||
//} elseif (($oembed_data->type == "photo") AND isset($oembed_data->url) AND !$dontincludemedia) {
|
//} elseif (($oembed_data->type == "photo") AND isset($oembed_data->url) AND !$dontincludemedia) {
|
||||||
|
@ -1177,7 +1177,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
|
||||||
$body = str_replace($url->url, "[url=" . $expanded_url . "][img]" . $oembed_data->url . "[/img][/url]", $body);
|
$body = str_replace($url->url, "[url=" . $expanded_url . "][img]" . $oembed_data->url . "[/img][/url]", $body);
|
||||||
//$dontincludemedia = true;
|
//$dontincludemedia = true;
|
||||||
} elseif ($oembed_data->type != "link") {
|
} elseif ($oembed_data->type != "link") {
|
||||||
$body = str_replace($url->url, "[url=" . $expanded_url . "]" . $expanded_url . "[/url]", $body);
|
$body = str_replace($url->url, "[url=" . $expanded_url . "]" . $url->display_url . "[/url]", $body);
|
||||||
} else {
|
} else {
|
||||||
$img_str = Network::fetchUrl($expanded_url, true, $redirects, 4);
|
$img_str = Network::fetchUrl($expanded_url, true, $redirects, 4);
|
||||||
|
|
||||||
|
@ -1200,7 +1200,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
|
||||||
} else {
|
} else {
|
||||||
$type = $oembed_data->type;
|
$type = $oembed_data->type;
|
||||||
$footerurl = $expanded_url;
|
$footerurl = $expanded_url;
|
||||||
$footerlink = "[url=" . $expanded_url . "]" . $expanded_url . "[/url]";
|
$footerlink = "[url=" . $expanded_url . "]" . $url->display_url . "[/url]";
|
||||||
|
|
||||||
$body = str_replace($url->url, $footerlink, $body);
|
$body = str_replace($url->url, $footerlink, $body);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue