1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 23:10:57 +01:00

Fix mail parameter error with old migrations

Summary:
Fixes T9251. Old mail could get saved with bad parameters for two reasons that I can come up with:

  - Nothing ever set a parameter on it -- not sure this could ever actually happen; or
  - some field contained non-UTF8 data prior to D13939 and we silently failed to encode it.

My guess is that the second case is probably the culprit here.

In any case, recover from this so `20150622.metamta.5.actor-phid-mig.php` can proceed.

Test Plan: Same effective patch as user patch in T9251; looked at some mail to make sure it was still pulling parameters properly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9251

Differential Revision: https://secure.phabricator.com/D13990
This commit is contained in:
epriestley 2015-08-24 09:37:48 -07:00
parent c612579854
commit 779a612e41

View file

@ -10,7 +10,7 @@ final class PhabricatorMetaMTAMail
const RETRY_DELAY = 5; const RETRY_DELAY = 5;
protected $actorPHID; protected $actorPHID;
protected $parameters; protected $parameters = array();
protected $status; protected $status;
protected $message; protected $message;
protected $relatedPHID; protected $relatedPHID;
@ -69,6 +69,13 @@ final class PhabricatorMetaMTAMail
} }
protected function getParam($param, $default = null) { protected function getParam($param, $default = null) {
// Some old mail was saved without parameters because no parameters were
// set or encoding failed. Recover in these cases so we can perform
// mail migrations, see T9251.
if (!is_array($this->parameters)) {
$this->parameters = array();
}
return idx($this->parameters, $param, $default); return idx($this->parameters, $param, $default);
} }