1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 18:22:41 +01:00

Raise a tailored error message on "show-outbound --id cat"

Summary: Fixes T12579. Unclear why the user ran this command.

Test Plan: Ran with `--id cat`. Ran with `--id 123`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12579

Differential Revision: https://secure.phabricator.com/D17719
This commit is contained in:
epriestley 2017-04-18 09:00:52 -07:00
parent b54adc6161
commit 8377bb3637

View file

@ -37,6 +37,15 @@ final class PhabricatorMailManagementShowOutboundWorkflow
'--id')); '--id'));
} }
foreach ($ids as $id) {
if (!ctype_digit($id)) {
throw new PhutilArgumentUsageException(
pht(
'Argument "%s" is not a valid message ID.',
$id));
}
}
$messages = id(new PhabricatorMetaMTAMail())->loadAllWhere( $messages = id(new PhabricatorMetaMTAMail())->loadAllWhere(
'id IN (%Ld)', 'id IN (%Ld)',
$ids); $ids);