]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Use HTTPS for links to Twitter profiles as well
authorStephen Paul Weber <singpolyma@singpolyma.net>
Fri, 23 Oct 2015 16:24:04 +0000 (16:24 +0000)
committerStephen Paul Weber <singpolyma@singpolyma.net>
Fri, 23 Oct 2015 16:24:04 +0000 (16:24 +0000)
plugins/TwitterBridge/lib/twitterimport.php

index e4621df90c72722df73f37e10399078909c407c1..70c9093fa2f202fdd1d4cd39ed975822d9d9b6d9 100644 (file)
@@ -241,6 +241,16 @@ class TwitterImport
     protected function ensureProfile($twuser)
     {
         // check to see if there's already a profile for this user
+        $profileurl = 'https://twitter.com/' . $twuser->screen_name;
+        try {
+            $profile = $this->getProfileByUrl($twuser->screen_name, $profileurl);
+            $this->updateAvatar($twuser, $profile);
+            return $profile;
+        } catch (NoResultException $e) {
+            common_debug(__METHOD__ . ' - Falling back to check for http: ' .
+                         "for Twitter user: $profileurl.");
+        }
+
         $profileurl = 'http://twitter.com/' . $twuser->screen_name;
         try {
             $profile = $this->getProfileByUrl($twuser->screen_name, $profileurl);
@@ -527,9 +537,9 @@ class TwitterImport
     static function atLink($screenName, $fullName, $orig)
     {
         if (!empty($fullName)) {
-            return "<a href='http://twitter.com/#!/{$screenName}' title='{$fullName}'>{$orig}</a>";
+            return "<a href='https://twitter.com/{$screenName}' title='{$fullName}'>{$orig}</a>";
         } else {
-            return "<a href='http://twitter.com/#!/{$screenName}'>{$orig}</a>";
+            return "<a href='https://twitter.com/{$screenName}'>{$orig}</a>";
         }
     }