From 1c73d6cd067a31411a82847b6d86d57ed0c4f88f Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 8 Nov 2013 11:09:09 -0800 Subject: [PATCH] Tighten a regular expression in `repository.create` Summary: See . We were missing a "^" here. This should be moved over to transactions soon and then we can get rid of the duplication. :/ Test Plan: Tried to create a repository with callsign "9X", got a helpful error about "ALL UPPERCASE LETTERS". Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7531 --- .../repository/conduit/ConduitAPI_repository_create_Method.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php b/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php index 7fba83c15d..cb6237bbd1 100644 --- a/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php +++ b/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php @@ -83,7 +83,7 @@ final class ConduitAPI_repository_create_Method $repository->setName($request->getValue('name')); $callsign = $request->getValue('callsign'); - if (!preg_match('/[A-Z]+$/', $callsign)) { + if (!preg_match('/^[A-Z]+$/', $callsign)) { throw new ConduitException('ERR-BAD-CALLSIGN'); } $repository->setCallsign($callsign);