From 935f3657b51c05abd317aa4c479ab1e62bc66c28 Mon Sep 17 00:00:00 2001 From: vrana Date: Tue, 10 Apr 2012 00:55:31 -0700 Subject: [PATCH] Allow %f2 and other escape sequences in editor link Test Plan: Open in Editor. Reviewers: epriestley Reviewed By: epriestley CC: aran Differential Revision: https://secure.phabricator.com/D2184 --- .../PhabricatorUserPreferenceSettingsPanelController.php | 2 +- src/applications/people/storage/user/PhabricatorUser.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/applications/people/controller/settings/panels/preferences/PhabricatorUserPreferenceSettingsPanelController.php b/src/applications/people/controller/settings/panels/preferences/PhabricatorUserPreferenceSettingsPanelController.php index 8281c1ee6e..1edd725ae1 100644 --- a/src/applications/people/controller/settings/panels/preferences/PhabricatorUserPreferenceSettingsPanelController.php +++ b/src/applications/people/controller/settings/panels/preferences/PhabricatorUserPreferenceSettingsPanelController.php @@ -81,7 +81,7 @@ EXAMPLE; ->setCaption( 'Link to edit files in external editor. '. '%f is replaced by filename, %l by line number, %r by repository '. - 'callsign. '. + 'callsign, %% by literal %. '. "For documentation, see {$editor_doc_link}.") ->setValue($preferences->getPreference($pref_editor))) ->appendChild( diff --git a/src/applications/people/storage/user/PhabricatorUser.php b/src/applications/people/storage/user/PhabricatorUser.php index 14b171e784..ae28af5609 100644 --- a/src/applications/people/storage/user/PhabricatorUser.php +++ b/src/applications/people/storage/user/PhabricatorUser.php @@ -418,6 +418,7 @@ final class PhabricatorUser extends PhabricatorUserDAO { PhabricatorUserPreferences::PREFERENCE_EDITOR); if ($editor) { return strtr($editor, array( + '%%' => '%', '%f' => phutil_escape_uri($path), '%l' => phutil_escape_uri($line), '%r' => phutil_escape_uri($callsign),