]> git.mxchange.org Git - friendica-addons.git/commitdiff
[twitter] Keep original display URL after link expansion
authorHypolite Petovan <mrpetovan@gmail.com>
Wed, 8 Aug 2018 21:43:00 +0000 (23:43 +0200)
committerHypolite Petovan <mrpetovan@gmail.com>
Wed, 8 Aug 2018 21:43:00 +0000 (23:43 +0200)
twitter/twitter.php

index 9de7b47d8b4dbf62b766d056eb58a35fbbce521a..ca693812297a1c68ff32f170c039ffe027b4379b 100644 (file)
@@ -1169,7 +1169,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
                                        //$dontincludemedia = true;
                                        $type = $oembed_data->type;
                                        $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);
                                        //} 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);
                                        //$dontincludemedia = true;
                                } 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 {
                                        $img_str = Network::fetchUrl($expanded_url, true, $redirects, 4);
 
@@ -1200,7 +1200,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
                                        } else {
                                                $type = $oembed_data->type;
                                                $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);
                                        }