Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorAuthProvider.php
Show First 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | private function didUpdateAccount(PhabricatorExternalAccount $account) { | ||||
$account->setRealName($adapter->getAccountRealName()); | $account->setRealName($adapter->getAccountRealName()); | ||||
$account->setEmail($adapter->getAccountEmail()); | $account->setEmail($adapter->getAccountEmail()); | ||||
$account->setAccountURI($adapter->getAccountURI()); | $account->setAccountURI($adapter->getAccountURI()); | ||||
$account->setProfileImagePHID(null); | $account->setProfileImagePHID(null); | ||||
$image_uri = $adapter->getAccountImageURI(); | $image_uri = $adapter->getAccountImageURI(); | ||||
if ($image_uri) { | if ($image_uri) { | ||||
try { | try { | ||||
$name = PhabricatorSlug::normalize($this->getProviderName()); | $name = PhabricatorSlug::normalize($this->getLoginIcon()); | ||||
epriestley: Yes, it should. This code will produce the wrong outcome if provider names are translated… | |||||
$name = $name.'-profile.jpg'; | $name = $name.'-profile.jpg'; | ||||
// TODO: If the image has not changed, we do not need to make a new | // TODO: If the image has not changed, we do not need to make a new | ||||
// file entry for it, but there's no convenient way to do this with | // file entry for it, but there's no convenient way to do this with | ||||
// PhabricatorFile right now. The storage will get shared, so the impact | // PhabricatorFile right now. The storage will get shared, so the impact | ||||
// here is negligible. | // here is negligible. | ||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | ||||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |
Yes, it should. This code will produce the wrong outcome if provider names are translated, although it's probably common for providers like "Amazon" or "GitHub" to localize to the same string.