Skip to content

Commit

Permalink
Merge pull request #2081 from nextcloud/fix/twitter-uri
Browse files Browse the repository at this point in the history
adapted twitter uri
  • Loading branch information
skjnldsv authored Feb 23, 2021
2 parents 308ca32 + b4b7ad6 commit 9d3cc8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/Service/Social/TwitterProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public function getImageUrls(array $contact):array {
$profileIds = $this->getProfileIds($contact);
$urls = [];
foreach ($profileIds as $profileId) {
$recipe = 'https://mobile.twitter.com/{socialId}';
$recipe = 'https://twitter.com/{socialId}';
$connector = str_replace("{socialId}", $profileId, $recipe);
$connector = $this->getFromHtml($connector, '_normal');
$connector = $this->getFromHtml($connector, 'profile_image');
$urls[] = $connector;
}
return $urls;
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/Service/Social/TwitterProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ public function dataProviderGetImageUrls() {
]
];
$contactWithSocialUrls = [
"https://mobile.twitter.com/username1",
"https://mobile.twitter.com/username2",
"https://twitter.com/username1",
"https://twitter.com/username2",
];
$contactWithSocialHtml = [
'<html><img src="username1_normal.jpg" /></html>',
'<html><img src="username2_normal.jpg" /></html>',
'<html><img src="./profile_images/username1_normal.jpg" /></html>',
'<html><img src="./profile_images/username2_normal.jpg" /></html>',
];
$contactWithSocialImgs = [
"username1_400x400.jpg",
"username2_400x400.jpg"
"./profile_images/username1_400x400.jpg",
"./profile_images/username2_400x400.jpg"
];

$contactWithoutSocial = [
Expand Down

0 comments on commit 9d3cc8f

Please sign in to comment.