diff --git a/src/applications/diffusion/request/base/DiffusionRequest.php b/src/applications/diffusion/request/base/DiffusionRequest.php index c10146a981..5d4d0cafd8 100644 --- a/src/applications/diffusion/request/base/DiffusionRequest.php +++ b/src/applications/diffusion/request/base/DiffusionRequest.php @@ -351,6 +351,7 @@ abstract class DiffusionRequest { $path = "{$branch}{$path}"; if (strlen($commit)) { + $commit = str_replace('$', '$$', $commit); $commit = ';'.phutil_escape_uri($commit); } @@ -471,20 +472,30 @@ abstract class DiffusionRequest { // Consume the back part of the URI, up to the first "$". Use a negative // lookbehind to prevent matching '$$'. We double the '$' symbol when // encoding so that files with names like "money/$100" will survive. - if (preg_match('@(? array( 'branch' => 'a/b', ), + 'branch/path/;Version-1_0_0' => array( + 'branch' => 'branch', + 'path' => 'path/', + 'commit' => 'Version-1_0_0', + ), + 'branch/path/;$$moneytag$$' => array( + 'branch' => 'branch', + 'path' => 'path/', + 'commit' => '$moneytag$', + ), + 'branch/path/semicolon;;;;;$$;;semicolon;;$$$$$100' => array( + 'branch' => 'branch', + 'path' => 'path/semicolon;;', + 'commit' => '$;;semicolon;;$$', + 'line' => '100', + ), ); foreach ($map as $input => $expect) { diff --git a/src/applications/diffusion/view/taglist/DiffusionTagListView.php b/src/applications/diffusion/view/taglist/DiffusionTagListView.php index b26c147050..080f4a841d 100644 --- a/src/applications/diffusion/view/taglist/DiffusionTagListView.php +++ b/src/applications/diffusion/view/taglist/DiffusionTagListView.php @@ -62,7 +62,7 @@ final class DiffusionTagListView extends DiffusionView { 'href' => $drequest->generateURI( array( 'action' => 'browse', - 'commit' => $tag->getCommitIdentifier(), + 'commit' => $tag->getName(), )), ), phutil_escape_html($tag->getName()));