1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-02 02:40:58 +01:00

Get the correct uri_path for a diffusion request.

Summary: there is a bug in getting the uri path. When the user clicks
a line number twice, the new rev number and the line number is attached
to the end of the original uri instead of substituting it.

Test Plan: clicking line number multiple times, for both git and svn.

Reviewers: epriestley

CC:

Differential Revision: 84
This commit is contained in:
jungejason 2011-03-26 00:14:04 -07:00
parent 431552c357
commit 1844a6f728
3 changed files with 10 additions and 1 deletions

View file

@ -88,7 +88,7 @@ class DiffusionBrowseFileController extends DiffusionController {
$file_content->getCorpus());
$data = explode("\n", rtrim($data));
$uri_path = $request->getPath();
$uri_path = $drequest->getUriPath();
$uri_rev = $drequest->getCommit();
$color = null;

View file

@ -92,6 +92,10 @@ class DiffusionRequest {
return $this->path;
}
public function getUriPath() {
return '/diffusion/'.$this->getCallsign().'/browse/'.$this->path;
}
public function getLine() {
return $this->line;
}

View file

@ -94,6 +94,11 @@ class DiffusionGitRequest extends DiffusionRequest {
throw new Exception("Unable to determine branch!");
}
public function getUriPath() {
return '/diffusion/'.$this->getCallsign().'/browse/'.
$this->branch.'/'.$this->path;
}
public function getCommit() {
if ($this->commit) {
return $this->commit;