1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

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
This commit is contained in:
Vlad Albulescu 2016-03-20 10:15:21 -07:00 committed by epriestley
parent 76f07ec80b
commit 130e1d1f68

View file

@ -79,7 +79,8 @@ final class DiffusionQueryPathsConduitAPIMethod
$offset = (int)$request->getValue('offset'); $offset = (int)$request->getValue('offset');
if (strlen($pattern)) { if (strlen($pattern)) {
$pattern = '/'.preg_quote($pattern, '/').'/'; // Add delimiters to the regex pattern.
$pattern = '('.$pattern.')';
} }
$results = array(); $results = array();