mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 13:22:42 +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:
parent
c612579854
commit
779a612e41
1 changed files with 8 additions and 1 deletions
|
@ -10,7 +10,7 @@ final class PhabricatorMetaMTAMail
|
|||
const RETRY_DELAY = 5;
|
||||
|
||||
protected $actorPHID;
|
||||
protected $parameters;
|
||||
protected $parameters = array();
|
||||
protected $status;
|
||||
protected $message;
|
||||
protected $relatedPHID;
|
||||
|
@ -69,6 +69,13 @@ final class PhabricatorMetaMTAMail
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue