Skip to content

Commit e4736bf

Browse files
author
vrana
committed
Avoid double escaping in error view title
Summary: Searched for `AphrontErrorView` and then for `setTitle()`. Test Plan: None. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2432 Differential Revision: https://secure.phabricator.com/D4880
1 parent 7ec8e88 commit e4736bf

5 files changed

+4
-10
lines changed

src/aphront/configuration/AphrontDefaultApplicationConfiguration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function handleException(Exception $ex) {
209209

210210
if ($ex instanceof AphrontUsageException) {
211211
$error = new AphrontErrorView();
212-
$error->setTitle(phutil_escape_html($ex->getTitle()));
212+
$error->setTitle($ex->getTitle());
213213
$error->appendChild($ex->getMessage());
214214

215215
$view = new PhabricatorStandardPageView();
@@ -226,7 +226,7 @@ public function handleException(Exception $ex) {
226226
// Always log the unhandled exception.
227227
phlog($ex);
228228

229-
$class = phutil_escape_html(get_class($ex));
229+
$class = get_class($ex);
230230
$message = phutil_escape_html($ex->getMessage());
231231

232232
if ($ex instanceof AphrontQuerySchemaException) {

src/applications/oauthserver/controller/client/PhabricatorOAuthClientDeleteController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ public function processRequest() {
3232
->setURI('/oauthserver/client/?deleted=1');
3333
}
3434

35-
$client_name = phutil_escape_html($client->getName());
36-
$title .= ' '.$client_name;
35+
$title .= ' '.$client->getName();
3736

3837
$dialog = new AphrontDialogView();
3938
$dialog->setUser($current_user);

src/applications/oauthserver/controller/client/PhabricatorOAuthClientListController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,8 @@ private function getNoticeView() {
113113
$new = $this->getRequest()->getStr('new');
114114
$deleted = $this->getRequest()->getBool('deleted');
115115
if ($edited) {
116-
$edited = phutil_escape_html($edited);
117116
$title = 'Successfully edited client with id '.$edited.'.';
118117
} else if ($new) {
119-
$new = phutil_escape_html($new);
120118
$title = 'Successfully created client with id '.$new.'.';
121119
} else if ($deleted) {
122120
$title = 'Successfully deleted client.';

src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationDeleteController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ public function processRequest() {
3737
->loadOneWhere('phid = %s',
3838
$client_phid);
3939
if ($client) {
40-
$client_name = phutil_escape_html($client->getName());
41-
$title .= ' for '.$client_name;
40+
$title .= ' for '.$client->getName();
4241
} else {
4342
// the client does not exist so token is dead already (but
4443
// let's let the user clean this up anyway in that case)
45-
$client_name = '';
4644
}
4745

4846
$dialog = new AphrontDialogView();

src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ private function getNoticeView() {
137137
$edited = $this->getRequest()->getStr('edited');
138138
$deleted = $this->getRequest()->getBool('deleted');
139139
if ($edited) {
140-
$edited = phutil_escape_html($edited);
141140
$title = 'Successfully edited client authorization.';
142141
} else if ($deleted) {
143142
$title = 'Successfully deleted client authorization.';

0 commit comments

Comments
 (0)