From 130e1d1f68a4dc4c41559be11971301cbb656317 Mon Sep 17 00:00:00 2001 From: Vlad Albulescu Date: Sun, 20 Mar 2016 10:15:21 -0700 Subject: [PATCH] Unbreak regex filename search Summary: D9087 adds a nice typeahead but breaks the existing regex search by quoting the pattern. Ideally, this change won't break the typeahead, which as far as I can tell doesn't use the `pattern` argument. Test Plan: Not yet. RFC as to whether this change makes sense, will fix my local setup and resend if so. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15500 --- .../diffusion/conduit/DiffusionQueryPathsConduitAPIMethod.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/applications/diffusion/conduit/DiffusionQueryPathsConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionQueryPathsConduitAPIMethod.php index 5ca2783838..be2f07f2c6 100644 --- a/src/applications/diffusion/conduit/DiffusionQueryPathsConduitAPIMethod.php +++ b/src/applications/diffusion/conduit/DiffusionQueryPathsConduitAPIMethod.php @@ -79,7 +79,8 @@ final class DiffusionQueryPathsConduitAPIMethod $offset = (int)$request->getValue('offset'); if (strlen($pattern)) { - $pattern = '/'.preg_quote($pattern, '/').'/'; + // Add delimiters to the regex pattern. + $pattern = '('.$pattern.')'; } $results = array();