This commit is contained in:
James Cole 2019-09-07 19:40:44 +02:00
parent 0c967cb011
commit 1c68b0902d
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -106,6 +106,10 @@ class AccountValidator
return false;
}
// whatever happens, source cannot equal destination:
switch ($this->transactionType) {
default:
$this->destError = sprintf('AccountValidator::validateDestination cannot handle "%s", so it will always return false.', $this->transactionType);
@ -508,7 +512,14 @@ class AccountValidator
$this->destination = $search;
// must not be the same as the source account
return !(null !== $this->source && $this->source->id === $this->destination->id);
if (null !== $this->source && $this->source->id === $this->destination->id) {
$this->sourceError = 'Source and destination are the same.';
$this->destError = 'Source and destination are the same.';
return false;
}
return true;
}
/**