Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2859886
sell_private_user_data_to_the_highest_bidder.diff
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
epriestley
Feb 13 2017, 4:24 PM
2017-02-13 16:24:01 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
sell_private_user_data_to_the_highest_bidder.diff
View Options
diff --git a/src/applications/differential/storage/DifferentialDiff.php b/src/applications/differential/storage/DifferentialDiff.php
index 415c46bb27..1814355cfd 100644
--- a/src/applications/differential/storage/DifferentialDiff.php
+++ b/src/applications/differential/storage/DifferentialDiff.php
@@ -313,6 +313,38 @@ final class DifferentialDiff
}
}
+ // If we were unable to pull authorship data from commit metadata and
+ // this diff is associated with a revision, use the revision author's
+ // account details instead.
+ if (!strlen(idx($dict, 'authorEmail'))) {
+ if ($this->hasRevision()) {
+ $viewer = PhabricatorUser::getOmnipotentUser();
+
+ $revision = $this->getRevision();
+ $author_phid = $revision->getAuthorPHID();
+
+ $author = id(new PhabricatorUserQuery())
+ ->setViewer($viewer)
+ ->withPHIDs(array($author_phid))
+ ->executeOne();
+ if ($author) {
+ $email = id(new PhabricatorUserEmail())->loadOneWhere(
+ 'userPHID = %s AND isPrimary = 1',
+ $author->getPHID());
+ if ($email) {
+ $author_name = $author->getRealName();
+ if (!strlen($author_name)) {
+ $author_name = $author->getUsername();
+ }
+ $author_email = $email->getAddress();
+
+ $dict['authorName'] = $author_name;
+ $dict['authorEmail'] = $author_email;
+ }
+ }
+ }
+ }
+
return $dict;
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
480793
Default Alt Text
sell_private_user_data_to_the_highest_bidder.diff (1 KB)
Attached To
Mode
P2031 sell_private_user_data_to_the_highest_bidder.diff
Attached
Detach File
Event Timeline
Log In to Comment