Page MenuHomePhabricator

D12788.id30740.diff
No OneTemporary

D12788.id30740.diff

diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
--- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php
+++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
@@ -384,7 +384,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($phid == $this->getUserPHID());
+ return (!is_null($phid) && $phid == $this->getUserPHID());
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php
--- a/src/applications/differential/storage/DifferentialRevision.php
+++ b/src/applications/differential/storage/DifferentialRevision.php
@@ -402,6 +402,9 @@
public function isAutomaticallySubscribed($phid) {
+ if (is_null($phid)) {
+ return false;
+ }
if ($phid == $this->getAuthorPHID()) {
return true;
}
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -1356,7 +1356,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($this->authorPHID == $phid);
+ return (!is_null($phid) && $this->authorPHID == $phid);
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/fund/storage/FundInitiative.php b/src/applications/fund/storage/FundInitiative.php
--- a/src/applications/fund/storage/FundInitiative.php
+++ b/src/applications/fund/storage/FundInitiative.php
@@ -175,7 +175,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($phid == $this->getOwnerPHID());
+ return (!is_null($phid) && $phid == $this->getOwnerPHID());
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/legalpad/storage/LegalpadDocument.php b/src/applications/legalpad/storage/LegalpadDocument.php
--- a/src/applications/legalpad/storage/LegalpadDocument.php
+++ b/src/applications/legalpad/storage/LegalpadDocument.php
@@ -160,7 +160,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($this->creatorPHID == $phid);
+ return (!is_null($phid) && $this->creatorPHID == $phid);
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php
--- a/src/applications/maniphest/storage/ManiphestTask.php
+++ b/src/applications/maniphest/storage/ManiphestTask.php
@@ -213,7 +213,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($phid == $this->getOwnerPHID());
+ return (!is_null($phid) && $phid == $this->getOwnerPHID());
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/paste/storage/PhabricatorPaste.php b/src/applications/paste/storage/PhabricatorPaste.php
--- a/src/applications/paste/storage/PhabricatorPaste.php
+++ b/src/applications/paste/storage/PhabricatorPaste.php
@@ -115,7 +115,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($this->authorPHID == $phid);
+ return (!is_null($phid) && $this->authorPHID == $phid);
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/pholio/storage/PholioMock.php b/src/applications/pholio/storage/PholioMock.php
--- a/src/applications/pholio/storage/PholioMock.php
+++ b/src/applications/pholio/storage/PholioMock.php
@@ -173,7 +173,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($this->authorPHID == $phid);
+ return (!is_null($phid) && $this->authorPHID == $phid);
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/ponder/storage/PonderAnswer.php b/src/applications/ponder/storage/PonderAnswer.php
--- a/src/applications/ponder/storage/PonderAnswer.php
+++ b/src/applications/ponder/storage/PonderAnswer.php
@@ -235,7 +235,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($phid == $this->getAuthorPHID());
+ return (!is_null($phid) && $phid == $this->getAuthorPHID());
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/ponder/storage/PonderQuestion.php b/src/applications/ponder/storage/PonderQuestion.php
--- a/src/applications/ponder/storage/PonderQuestion.php
+++ b/src/applications/ponder/storage/PonderQuestion.php
@@ -260,7 +260,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($phid == $this->getAuthorPHID());
+ return (!is_null($phid) && $phid == $this->getAuthorPHID());
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
--- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
@@ -376,7 +376,7 @@
// TODO: This should also list auditors, but handling that is a bit messy
// right now because we are not guaranteed to have the data.
- return ($phid == $this->getAuthorPHID());
+ return (!is_null($phid) && $phid == $this->getAuthorPHID());
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php b/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
--- a/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
+++ b/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
@@ -160,7 +160,7 @@
public function isAutomaticallySubscribed($phid) {
- return ($phid == $this->getAuthorPHID());
+ return (!is_null($phid) && $phid == $this->getAuthorPHID());
}
public function shouldShowSubscribersProperty() {
diff --git a/src/applications/subscriptions/interface/PhabricatorSubscribableInterface.php b/src/applications/subscriptions/interface/PhabricatorSubscribableInterface.php
--- a/src/applications/subscriptions/interface/PhabricatorSubscribableInterface.php
+++ b/src/applications/subscriptions/interface/PhabricatorSubscribableInterface.php
@@ -7,6 +7,8 @@
* to the object (for example, they are the author or in some other way
* irrevocably a subscriber). This will, e.g., cause the UI to render
* "Automatically Subscribed" instead of "Subscribe".
+ * Watch out for $phid being NULL for logged out users and also the owner ID
+ * of un-owned objects.
*
* @param PHID PHID (presumably a user) to test for automatic subscription.
* @return bool True if the object/user is automatically subscribed.

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 4:57 AM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705886
Default Alt Text
D12788.id30740.diff (6 KB)

Event Timeline