Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13981019
D11955.id28781.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11955.id28781.diff
View Options
diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php
--- a/src/applications/conpherence/editor/ConpherenceEditor.php
+++ b/src/applications/conpherence/editor/ConpherenceEditor.php
@@ -478,4 +478,43 @@
);
}
+ protected function validateTransaction(
+ PhabricatorLiskDAO $object,
+ $type,
+ array $xactions) {
+
+ $errors = parent::validateTransaction($object, $type, $xactions);
+
+ switch ($type) {
+ case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ foreach ($xactions as $xaction) {
+ $phids = $this->getPHIDTransactionNewValue(
+ $xaction,
+ $object->getParticipantPHIDs());
+
+ if (!$phids) {
+ continue;
+ }
+
+ $users = id(new PhabricatorPeopleQuery())
+ ->setViewer($this->requireActor())
+ ->withPHIDs($phids)
+ ->execute();
+ $users = mpull($users, null, 'getPHID');
+ foreach ($phids as $phid) {
+ if (isset($users[$phid])) {
+ continue;
+ }
+ $errors[] = new PhabricatorApplicationTransactionValidationError(
+ $type,
+ pht('Invalid'),
+ pht('New thread member "%s" is not a valid user.', $phid),
+ $xaction);
+ }
+ }
+ break;
+ }
+
+ return $errors;
+ }
}
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -1397,9 +1397,14 @@
}
protected function getPHIDTransactionNewValue(
- PhabricatorApplicationTransaction $xaction) {
+ PhabricatorApplicationTransaction $xaction,
+ $old = null) {
- $old = array_fuse($xaction->getOldValue());
+ if ($old) {
+ $old = array_fuse($old);
+ } else {
+ $old = array_fuse($xaction->getOldValue());
+ }
$new = $xaction->getNewValue();
$new_add = idx($new, '+', array());
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 1:51 PM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6710535
Default Alt Text
D11955.id28781.diff (2 KB)
Attached To
Mode
D11955: Forbid adding non-users to Conpherence threads
Attached
Detach File
Event Timeline
Log In to Comment