mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-22 12:41:19 +01:00
Link to a specific Phabricator version from stack trace
Summary: Line numbers and file paths may be different in current version. Test Plan: Disabled editor, issued exception, clicked on the link. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2886
This commit is contained in:
parent
46008ce3b3
commit
b10428fe60
1 changed files with 6 additions and 0 deletions
|
@ -630,6 +630,11 @@ class AphrontDefaultApplicationConfiguration
|
|||
|
||||
$libraries = PhutilBootloader::getInstance()->getAllLibraries();
|
||||
|
||||
$version = PhabricatorEnv::getEnvConfig('phabricator.version');
|
||||
if (preg_match('/[^a-f0-9]/i', $version)) {
|
||||
$version = '';
|
||||
}
|
||||
|
||||
// TODO: Make this configurable?
|
||||
$path = 'https://secure.phabricator.com/diffusion/%s/browse/master/src/';
|
||||
|
||||
|
@ -676,6 +681,7 @@ class AphrontDefaultApplicationConfiguration
|
|||
if (empty($attrs['href'])) {
|
||||
$attrs['href'] = sprintf($path, $callsigns[$lib]).
|
||||
str_replace(DIRECTORY_SEPARATOR, '/', $relative).
|
||||
($version && $lib == 'phabricator' ? ';'.$version : '').
|
||||
'$'.$part['line'];
|
||||
$attrs['target'] = '_blank';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue