Skip to content

Commit ad87ed1

Browse files
DavidHopkinsFbrdregad
authored andcommitted
Bug fixes in URL generators
1 parent 3957e15 commit ad87ed1

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

SourceVisualSVNServer/SourceVisualSVNServer.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,29 @@ protected function url_base( $p_repo ) {
6666
}
6767

6868
# Only include port in final URL if it was present originally
69-
$t_port = isset( $t_url['port'] ) ? ':' . $t_url['port'] : '';
70-
71-
return $t_url['scheme'] . '://' . $t_url['host'] . $t_port . '/!/#' . $t_repo_path;
69+
$t_port = isset( $t_repo_url['port'] ) ? ':' . $t_repo_url['port'] : '';
70+
71+
$t_url = $t_repo_url['scheme'] . '://' . $t_repo_url['host'] . $t_port . '/!/#' . $t_repo_path;
72+
return $t_url;
7273
}
7374

7475
public function url_repo( $p_repo, $p_changeset=null ) {
75-
$t_repo_url = $this->url_base( $p_repo );
76+
$t_url = $this->url_base( $p_repo );
7677

7778
if ( !is_null( $p_changeset ) ) {
7879
$t_revision = $p_changeset->revision;
79-
$t_repo_url .= '/view/r' . urlencode($t_revision) . '/';
80+
$t_url .= '/view/r' . urlencode($t_revision) . '/';
8081
}
8182

82-
return $t_repo_url;
83+
return $t_url;
8384
}
8485

8586
public function url_changeset( $p_repo, $p_changeset ) {
8687
$t_repo_url = $this->url_base( $p_repo );
8788
$t_revision = $p_changeset->revision;
8889

89-
return $t_repo_url . '/commit/r' . urlencode($t_revision) + '/';
90+
$t_url = $t_repo_url . '/commit/r' . urlencode($t_revision) . '/';
91+
return $t_url;
9092
}
9193

9294
public function url_file( $p_repo, $p_changeset, $p_file ) {
@@ -97,20 +99,24 @@ public function url_file( $p_repo, $p_changeset, $p_file ) {
9799
$t_revision = ($p_file->action == 'rm')
98100
? $p_changeset->revision - 1
99101
: $p_changeset->revision;
100-
101-
return $t_repo_url . '/view/r' . urlencode($t_revision) . '/' . $p_file;
102+
103+
$t_url = $t_repo_url . '/view/r' . urlencode($t_revision) . $p_file->filename;
104+
105+
return $t_url;
102106
}
103107

104108
public function url_diff( $p_repo, $p_changeset, $p_file ) {
105109
if ( $p_file->action == 'rm' || $p_file->action == 'add' ) {
106-
return '';
110+
# Return default no-link for add/remove change diffs
111+
return parent::url_diff($p_repo, $p_changeset, $p_file);
107112
}
108113

109114
# The web interface for VisualSVN Server displays file diffs as inline content
110115
# when viewing a particular commit.
111116
# It doesn't have a specific page for single-file diffs,
112117
# at least as of v3.9.5, 2019-04-29
113-
return url_changeset( $p_repo, $p_changeset );
118+
$t_url = $this->url_changeset( $p_repo, $p_changeset );
119+
return $t_url;
114120
}
115121

116122
public function update_repo_form( $p_repo ) {

0 commit comments

Comments
 (0)