Merge pull request #2081 from nextcloud/fix/twitter-uri

adapted twitter uri
This commit is contained in:
John Molakvoæ 2021-02-23 08:50:56 +01:00 committed by GitHub
commit 9d3cc8f44b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -69,9 +69,9 @@ class TwitterProvider implements ISocialProvider {
$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;

View File

@ -100,16 +100,16 @@ class TwitterProviderTest extends TestCase {
]
];
$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 = [