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:
parent
8065d72899
commit
5daf08048b
1 changed files with 2 additions and 5 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue