diff --git a/src/applications/auth/controller/oauth/PhabricatorOAuthLoginController.php b/src/applications/auth/controller/oauth/PhabricatorOAuthLoginController.php index a0207e650b..f24f952412 100644 --- a/src/applications/auth/controller/oauth/PhabricatorOAuthLoginController.php +++ b/src/applications/auth/controller/oauth/PhabricatorOAuthLoginController.php @@ -41,7 +41,7 @@ class PhabricatorOAuthLoginController extends PhabricatorAuthController { return new Aphront400Response(); } - $provider_name = phutil_escape_html($provider->getProviderName()); + $provider_name = $provider->getProviderName(); $provider_key = $provider->getProviderKey(); $request = $this->getRequest(); @@ -79,11 +79,13 @@ class PhabricatorOAuthLoginController extends PhabricatorAuthController { $dialog->setUser($current_user); $dialog->setTitle('Already Linked to Another Account'); $dialog->appendChild( - '

The '.$provider_name.' account you just authorized '. - 'is already linked to another Phabricator account. Before you can '. - 'associate your '.$provider_name.' account with this Phabriactor '. - 'account, you must unlink it from the Phabricator account it is '. - 'currently linked to.

'); + hsprintf( + '

The %s account you just authorized is already linked to '. + 'another Phabricator account. Before you can associate your %s '. + 'account with this Phabriactor account, you must unlink it from '. + 'the Phabricator account it is currently linked to.

', + $provider_name, + $provider_name)); $dialog->addCancelButton('/settings/page/'.$provider_key.'/'); return id(new AphrontDialogResponse())->setDialog($dialog); @@ -103,9 +105,12 @@ class PhabricatorOAuthLoginController extends PhabricatorAuthController { $dialog->setUser($current_user); $dialog->setTitle('Already Linked to an Account From This Provider'); $dialog->appendChild( - '

The account you are logged in with is already linked to a '. - $provider_name.' account. Before you can link it to a different '. - $provider_name.' account, you must unlink the old account.

'); + hsprintf( + '

The account you are logged in with is already linked to a %s '. + 'account. Before you can link it to a different %s account, you '. + 'must unlink the old account.

', + $provider_name, + $provider_name)); $dialog->addCancelButton('/settings/page/'.$provider_key.'/'); return id(new AphrontDialogResponse())->setDialog($dialog); } @@ -113,10 +118,11 @@ class PhabricatorOAuthLoginController extends PhabricatorAuthController { if (!$request->isDialogFormPost()) { $dialog = new AphrontDialogView(); $dialog->setUser($current_user); - $dialog->setTitle('Link '.$provider->getProviderName().' Account'); + $dialog->setTitle('Link '.$provider_name.' Account'); $dialog->appendChild( - '

Link your '.$provider_name.' account to your Phabricator '. - 'account?

'); + hsprintf( + '

Link your %s account to your Phabricator account?

', + $provider_name)); $dialog->addHiddenInput('token', $provider->getAccessToken()); $dialog->addHiddenInput('expires', $oauth_info->getTokenExpires()); $dialog->addHiddenInput('state', $this->oauthState); @@ -171,10 +177,12 @@ class PhabricatorOAuthLoginController extends PhabricatorAuthController { $dialog->setUser($current_user); $dialog->setTitle('Already Linked to Another Account'); $dialog->appendChild( - '

The '.$provider_name.' account you just authorized has an '. - 'email address which is already in use by another Phabricator '. - 'account. To link the accounts, log in to your Phabricator '. - 'account and then go to Settings.

'); + hsprintf( + '

The %s account you just authorized has an email address which '. + 'is already in use by another Phabricator account. To link the '. + 'accounts, log in to your Phabricator account and then go to '. + 'Settings.

', + $provider_name)); $dialog->addCancelButton('/login/'); return id(new AphrontDialogResponse())->setDialog($dialog); @@ -184,13 +192,14 @@ class PhabricatorOAuthLoginController extends PhabricatorAuthController { if (!$provider->isProviderRegistrationEnabled()) { $dialog = new AphrontDialogView(); $dialog->setUser($current_user); - $dialog->setTitle('No Account Registration With '. - $provider->getProviderName()); + $dialog->setTitle('No Account Registration With '.$provider_name); $dialog->appendChild( - '

You can not register a new account using '.$provider_name.'; '. - 'you can only use your '.$provider_name.' account to log into an '. - 'existing Phabricator account which you have registered through '. - 'other means.

'); + hsprintf( + '

You can not register a new account using %s; you can only use '. + 'your %s account to log into an existing Phabricator account which '. + 'you have registered through other means.

', + $provider_name, + $provider_name)); $dialog->addCancelButton('/login/'); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/auth/view/oauthfailure/PhabricatorOAuthFailureView.php b/src/applications/auth/view/oauthfailure/PhabricatorOAuthFailureView.php index 5808c2358b..e334614e60 100644 --- a/src/applications/auth/view/oauthfailure/PhabricatorOAuthFailureView.php +++ b/src/applications/auth/view/oauthfailure/PhabricatorOAuthFailureView.php @@ -34,49 +34,51 @@ class PhabricatorOAuthFailureView extends AphrontView { public function render() { $request = $this->request; $provider = $this->provider; - $provider_name = phutil_escape_html($provider->getProviderName()); + $provider_name = $provider->getProviderName(); $diagnose = null; $view = new AphrontRequestFailureView(); - $view->setHeader($provider->getProviderName().' Auth Failed'); + $view->setHeader($provider_name.' Auth Failed'); if ($this->request) { $view->appendChild( - '

'. - 'Description: '. - phutil_escape_html($request->getStr('error_description')). - '

'); + hsprintf( + '

Description: %s

', + $request->getStr('error_description'))); $view->appendChild( - '

'. - 'Error: '. - phutil_escape_html($request->getStr('error')). - '

'); + hsprintf( + '

Error: %s

', + $request->getStr('error'))); $view->appendChild( - '

'. - 'Error Reason: '. - phutil_escape_html($request->getStr('error_reason')). - '

'); + hsprintf( + '

Error Reason: %s

', + $request->getStr('error_reason'))); } else { // TODO: We can probably refine this. $view->appendChild( - '

Unable to authenticate with '.$provider_name.'. '. - 'There are several reasons this might happen:

'. - ''. - '

You can try again, or login using another method.

'); + hsprintf( + '

Unable to authenticate with %s. '. + 'There are several reasons this might happen:

'. + ''. + '

You can try again, or login using another method.

', + $provider_name, + $provider_name, + $provider_name, + $provider_name)); $provider_key = $provider->getProviderKey(); - $diagnose = + $diagnose = hsprintf( ''. - 'Diagnose '.$provider_name.' OAuth Problems'. - ''; + 'Diagnose %s OAuth Problems'. + '', + $provider_name); } $view->appendChild(