From 9dd09f717192bd9a05fb227c767960acbaa182b5 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Fri, 17 Oct 2014 09:56:34 -0700 Subject: [PATCH] Remove gravatar support Summary: Fixes T6261. The performance of asking gravatar for these images is horrible and causing lots of people to have issues with the page. Test Plan: noted how wildly fast the edit profile picture page loaded Reviewers: chad, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6261 Differential Revision: https://secure.phabricator.com/D10724 --- ...bricatorPeopleProfilePictureController.php | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php index 190d3f1c62..3dab246787 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php @@ -156,51 +156,6 @@ final class PhabricatorPeopleProfilePictureController } } - // Try to add Gravatar images for any email addresses associated with the - // account. - if (PhabricatorEnv::getEnvConfig('security.allow-outbound-http')) { - $emails = id(new PhabricatorUserEmail())->loadAllWhere( - 'userPHID = %s ORDER BY address', - $user->getPHID()); - - $futures = array(); - foreach ($emails as $email_object) { - $email = $email_object->getAddress(); - - $hash = md5(strtolower(trim($email))); - $uri = id(new PhutilURI("https://secure.gravatar.com/avatar/{$hash}")) - ->setQueryParams( - array( - 'size' => 200, - 'default' => '404', - 'rating' => 'x', - )); - $futures[$email] = new HTTPSFuture($uri); - } - - $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); - foreach (Futures($futures) as $email => $future) { - try { - list($body) = $future->resolvex(); - $file = PhabricatorFile::newFromFileData( - $body, - array( - 'name' => 'profile-gravatar', - 'ttl' => (60 * 60 * 4), - )); - if ($file->isTransformableImage()) { - $images[$file->getPHID()] = array( - 'uri' => $file->getBestURI(), - 'tip' => pht('Gravatar for %s', $email), - ); - } - } catch (Exception $ex) { - // Just continue. - } - } - unset($unguarded); - } - $images[PhabricatorPHIDConstants::PHID_VOID] = array( 'uri' => $default_image->getBestURI(), 'tip' => pht('Default Picture'),