@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Trim and URI encode symbol names before building URIs from them

Summary:
Fixes T13437. This URI construction was just missing URI encoding.

Also, trim the symbol because my test case ended up catching "#define\n" as symbol text.

Test Plan:
- Configured a repository to have PHP symbols.
- Touched a ".php" file with "#define" in it.
- Diffed the change.
- Command-clicked "#define" in the UI, in Safari/MacOS, to jump to the definition.
- Before: taken to a nonsense page where "#define" became an anchor.
- After: taken to symbol search for "#define".

Maniphest Tasks: T13437

Differential Revision: https://secure.phabricator.com/D20876

+19 -10
+9 -9
resources/celerity/map.php
··· 12 12 'core.pkg.css' => '686ae87c', 13 13 'core.pkg.js' => '6e5c894f', 14 14 'differential.pkg.css' => '607c84be', 15 - 'differential.pkg.js' => 'a0212a0b', 15 + 'differential.pkg.js' => '1b97518d', 16 16 'diffusion.pkg.css' => '42c75c37', 17 17 'diffusion.pkg.js' => 'a98c0bf7', 18 18 'maniphest.pkg.css' => '35995d6d', ··· 428 428 'rsrc/js/application/releeph/releeph-preview-branch.js' => '75184d68', 429 429 'rsrc/js/application/releeph/releeph-request-state-change.js' => '9f081f05', 430 430 'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'aa3a100c', 431 - 'rsrc/js/application/repository/repository-crossreference.js' => 'c15122b4', 431 + 'rsrc/js/application/repository/repository-crossreference.js' => '1c95ea63', 432 432 'rsrc/js/application/search/behavior-reorder-profile-menu-items.js' => 'e5bdb730', 433 433 'rsrc/js/application/search/behavior-reorder-queries.js' => 'b86f297f', 434 434 'rsrc/js/application/transactions/behavior-comment-actions.js' => '4dffaeb2', ··· 682 682 'javelin-behavior-reorder-applications' => 'aa371860', 683 683 'javelin-behavior-reorder-columns' => '8ac32fd9', 684 684 'javelin-behavior-reorder-profile-menu-items' => 'e5bdb730', 685 - 'javelin-behavior-repository-crossreference' => 'c15122b4', 685 + 'javelin-behavior-repository-crossreference' => '1c95ea63', 686 686 'javelin-behavior-scrollbar' => '92388bae', 687 687 'javelin-behavior-search-reorder-queries' => 'b86f297f', 688 688 'javelin-behavior-select-content' => 'e8240b50', ··· 1034 1034 'javelin-install', 1035 1035 'javelin-util', 1036 1036 ), 1037 + '1c95ea63' => array( 1038 + 'javelin-behavior', 1039 + 'javelin-dom', 1040 + 'javelin-stratcom', 1041 + 'javelin-uri', 1042 + ), 1037 1043 '1cab0e9a' => array( 1038 1044 'javelin-behavior', 1039 1045 'javelin-dom', ··· 1976 1982 ), 1977 1983 'c03f2fb4' => array( 1978 1984 'javelin-install', 1979 - ), 1980 - 'c15122b4' => array( 1981 - 'javelin-behavior', 1982 - 'javelin-dom', 1983 - 'javelin-stratcom', 1984 - 'javelin-uri', 1985 1985 ), 1986 1986 'c2c500a7' => array( 1987 1987 'javelin-install',
+10 -1
webroot/rsrc/js/application/repository/repository-crossreference.js
··· 152 152 query.char = char; 153 153 } 154 154 155 - var uri = JX.$U('/diffusion/symbol/' + symbol + '/'); 155 + var uri_symbol = symbol; 156 + 157 + // In some cases, lexers may include whitespace in symbol tags. Trim it, 158 + // since symbols with semantic whitespace aren't supported. 159 + uri_symbol = uri_symbol.trim(); 160 + 161 + // See T13437. Symbols like "#define" need to be encoded. 162 + uri_symbol = encodeURIComponent(uri_symbol); 163 + 164 + var uri = JX.$U('/diffusion/symbol/' + uri_symbol + '/'); 156 165 uri.addQueryParams(query); 157 166 158 167 window.open(uri.toString());