Skip to content

Commit cdc7008

Browse files
DavidHopkinsFbrdregad
authored andcommitted
Fix handling of empty repository prefixes
and encoding of non-empty repository prefixes
1 parent 840975c commit cdc7008

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

SourceVisualSVNServer/SourceVisualSVNServer.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,10 @@ protected function url_base( $p_repo ) {
5656

5757
$t_url_prefix = $this->get_visualsvnserver_url_prefix( $p_repo );
5858

59-
# Strip repo prefix (typically 'svn') from path, if present
60-
if ( !empty( $t_url_prefix ) ) {
61-
$t_prefix = '/' . $t_url_prefix . '/';
62-
63-
if (substr($t_repo_path, 0, strlen($t_prefix)) == $t_prefix) {
64-
$t_repo_path = substr($t_repo_path, strlen($t_prefix));
65-
}
59+
# Strip repo prefix (typically '/svn/') from path
60+
$t_prefix = empty( $t_url_prefix ) ? '/' : '/' . urlencode($t_url_prefix) . '/';
61+
if (substr($t_repo_path, 0, strlen($t_prefix)) == $t_prefix) {
62+
$t_repo_path = substr($t_repo_path, strlen($t_prefix));
6663
}
6764

6865
# Only include port in final URL if it was present originally

0 commit comments

Comments
 (0)