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

Fix path autocomplete

Summary: Paths autocompleter sometimes omits `/`.

Test Plan:
# Go to https://secure.phabricator.com/owners/new/.
# Write `/specs/h` to path.
# Delete the second slash resulting in `/specsh`.
# Don't find `/specshistorytest.html` in autocomplete.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2981
This commit is contained in:
vrana 2012-07-16 12:44:14 -07:00
parent 8065d72899
commit 5daf08048b

View file

@ -34,15 +34,12 @@ final class DiffusionPathCompleteController extends DiffusionController {
}
$query_path = $request->getStr('q');
$query_path = ltrim($query_path, '/');
if (preg_match('@/$@', $query_path)) {
$query_dir = $query_path;
} else {
$query_dir = dirname($query_path);
if ($query_dir == '.') {
$query_dir = '';
}
$query_dir = dirname($query_path).'/';
}
$query_dir = ltrim($query_dir, '/');
$drequest = DiffusionRequest::newFromDictionary(
array(