1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-28 20:18:13 +01:00

Resolve an issue with Diffusion URI parsing ignoring some information

Summary: Fixes T7011. Recent refactoring here caused us to begin ignoring URI parameters like `commit`. Most controllers take parameters as a `dblob`, which was still parsed properly.

Test Plan:
  - Editing different commits actually edits the desired commits.
  - Browsed around some `dblob` pages and verified they still work properly.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7011

Differential Revision: https://secure.phabricator.com/D11473
This commit is contained in:
epriestley 2015-01-23 08:36:27 -08:00
parent 614f911217
commit 30eea5e936

View file

@ -99,7 +99,17 @@ abstract class DiffusionRequest {
$object = self::newFromCallsign($callsign, $request->getUser());
$use_branches = $object->supportsBranches();
$parsed = self::parseRequestBlob(idx($data, 'dblob'), $use_branches);
if (isset($data['dblob'])) {
$parsed = self::parseRequestBlob(idx($data, 'dblob'), $use_branches);
} else {
$parsed = array(
'commit' => idx($data, 'commit'),
'path' => idx($data, 'path'),
'line' => idx($data, 'line'),
'branch' => idx($data, 'branch'),
);
}
$object->setUser($request->getUser());
$object->initializeFromDictionary($parsed);