From 8377bb363710277dcfa32ed1163498db84a826cd Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 18 Apr 2017 09:00:52 -0700 Subject: [PATCH] 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 --- .../PhabricatorMailManagementShowOutboundWorkflow.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php index b30f2685e6..54a91861ae 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php @@ -37,6 +37,15 @@ final class PhabricatorMailManagementShowOutboundWorkflow '--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( 'id IN (%Ld)', $ids);