'.
'The "xhprof" PHP extension is not available. Install xhprof '.
'to enable the XHProf console plugin. You can find instructions in '.
- 'the %s.'.
- '
');
$view = new PhabricatorStandardPageView();
$view->setTitle('403 Forbidden');
diff --git a/src/aphront/response/Aphront404Response.php b/src/aphront/response/Aphront404Response.php
index fbfa41a0da..2821012fc4 100644
--- a/src/aphront/response/Aphront404Response.php
+++ b/src/aphront/response/Aphront404Response.php
@@ -12,8 +12,7 @@ final class Aphront404Response extends AphrontHTMLResponse {
public function buildResponseString() {
$failure = new AphrontRequestFailureView();
$failure->setHeader('404 Not Found');
- $failure->appendChild(phutil_tag('p', array(), pht(
- 'The page you requested was not found.')));
+ $failure->appendChild('
The page you requested was not found.
');
$view = new PhabricatorStandardPageView();
$view->setTitle('404 Not Found');
diff --git a/src/aphront/response/AphrontWebpageResponse.php b/src/aphront/response/AphrontWebpageResponse.php
index 9bc2a54e83..4083b1be88 100644
--- a/src/aphront/response/AphrontWebpageResponse.php
+++ b/src/aphront/response/AphrontWebpageResponse.php
@@ -13,7 +13,7 @@ final class AphrontWebpageResponse extends AphrontHTMLResponse {
}
public function buildResponseString() {
- return hsprintf('%s', $this->content);
+ return $this->content;
}
}
diff --git a/src/applications/audit/controller/PhabricatorAuditListController.php b/src/applications/audit/controller/PhabricatorAuditListController.php
index d776fe12fd..d858dec6bf 100644
--- a/src/applications/audit/controller/PhabricatorAuditListController.php
+++ b/src/applications/audit/controller/PhabricatorAuditListController.php
@@ -335,7 +335,7 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
}
if ($handle) {
- $handle_name = $handle->getName();
+ $handle_name = phutil_escape_html($handle->getName());
} else {
$handle_name = null;
}
@@ -435,7 +435,7 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
}
if ($handle) {
- $handle_name = $handle->getName();
+ $handle_name = phutil_escape_html($handle->getName());
} else {
$handle_name = null;
}
diff --git a/src/applications/audit/view/PhabricatorAuditCommitListView.php b/src/applications/audit/view/PhabricatorAuditCommitListView.php
index dc674cec8b..6987fa117e 100644
--- a/src/applications/audit/view/PhabricatorAuditCommitListView.php
+++ b/src/applications/audit/view/PhabricatorAuditCommitListView.php
@@ -70,10 +70,10 @@ final class PhabricatorAuditCommitListView extends AphrontView {
$rows[] = array(
$commit_name,
$author_name,
- $commit->getCommitData()->getSummary(),
+ phutil_escape_html($commit->getCommitData()->getSummary()),
PhabricatorAuditCommitStatusConstants::getStatusName(
$commit->getAuditStatus()),
- phutil_implode_html(', ', $auditors),
+ implode(', ', $auditors),
phabricator_datetime($commit->getEpoch(), $this->user),
);
}
diff --git a/src/applications/audit/view/PhabricatorAuditListView.php b/src/applications/audit/view/PhabricatorAuditListView.php
index 5a7ef11a1f..2bac041aa1 100644
--- a/src/applications/audit/view/PhabricatorAuditListView.php
+++ b/src/applications/audit/view/PhabricatorAuditListView.php
@@ -129,7 +129,10 @@ final class PhabricatorAuditListView extends AphrontView {
}
$reasons = $audit->getAuditReasons();
- $reasons = phutil_implode_html(phutil_tag('br'), $reasons);
+ foreach ($reasons as $key => $reason) {
+ $reasons[$key] = phutil_escape_html($reason);
+ }
+ $reasons = implode(' ', $reasons);
$status_code = $audit->getAuditStatus();
$status = PhabricatorAuditStatusConstants::getStatusName($status_code);
@@ -137,10 +140,10 @@ final class PhabricatorAuditListView extends AphrontView {
$auditor_handle = $this->getHandle($audit->getAuditorPHID());
$rows[] = array(
$commit_name,
- $commit_desc,
+ phutil_escape_html($commit_desc),
$committed,
$auditor_handle->renderLink(),
- $status,
+ phutil_escape_html($status),
$reasons,
);
diff --git a/src/applications/auth/controller/PhabricatorDisabledUserController.php b/src/applications/auth/controller/PhabricatorDisabledUserController.php
index 364a9a61ec..dcd1e36abc 100644
--- a/src/applications/auth/controller/PhabricatorDisabledUserController.php
+++ b/src/applications/auth/controller/PhabricatorDisabledUserController.php
@@ -16,8 +16,8 @@ final class PhabricatorDisabledUserController
$failure_view = new AphrontRequestFailureView();
$failure_view->setHeader(pht('Account Disabled'));
- $failure_view->appendChild(phutil_tag('p', array(), pht(
- 'Your account has been disabled.')));
+ $failure_view->appendChild(
+ '
'.pht('Your account has been disabled.').'
');
return $this->buildStandardPageResponse(
$failure_view,
diff --git a/src/applications/auth/controller/PhabricatorEmailLoginController.php b/src/applications/auth/controller/PhabricatorEmailLoginController.php
index 3875de3c62..e6cc6372df 100644
--- a/src/applications/auth/controller/PhabricatorEmailLoginController.php
+++ b/src/applications/auth/controller/PhabricatorEmailLoginController.php
@@ -98,8 +98,10 @@ EOBODY;
$view = new AphrontRequestFailureView();
$view->setHeader(pht('Check Your Email'));
- $view->appendChild(phutil_tag('p', array(), pht(
- 'An email has been sent with a link you can use to login.')));
+ $view->appendChild(
+ '
'.pht(
+ 'An email has been sent with a link you can use to login.'
+ ).'
');
$panel->appendChild($email_auth);
$panel->setNoBackground();
diff --git a/src/applications/auth/controller/PhabricatorEmailTokenController.php b/src/applications/auth/controller/PhabricatorEmailTokenController.php
index 16a828f7de..855caa37af 100644
--- a/src/applications/auth/controller/PhabricatorEmailTokenController.php
+++ b/src/applications/auth/controller/PhabricatorEmailTokenController.php
@@ -50,16 +50,17 @@ final class PhabricatorEmailTokenController
$view = new AphrontRequestFailureView();
$view->setHeader(pht('Unable to Login'));
- $view->appendChild(phutil_tag('p', array(), pht(
- 'The authentication information in the link you clicked is '.
+ $view->appendChild(
+ '
'.pht('The authentication information in the link you clicked is '.
'invalid or out of date. Make sure you are copy-and-pasting the '.
'entire link into your browser. You can try again, or request '.
- 'a new email.')));
- $view->appendChild(hsprintf(
+ 'a new email.').'
',
- pht('Send Another Email')));
+ ''.
+ pht('Send Another Email').
+ ''.
+ '');
return $this->buildStandardPageResponse(
$view,
diff --git a/src/applications/auth/controller/PhabricatorLDAPLoginController.php b/src/applications/auth/controller/PhabricatorLDAPLoginController.php
index bbe64ccbd6..4dafe831f7 100644
--- a/src/applications/auth/controller/PhabricatorLDAPLoginController.php
+++ b/src/applications/auth/controller/PhabricatorLDAPLoginController.php
@@ -43,11 +43,12 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
$dialog = new AphrontDialogView();
$dialog->setUser($current_user);
$dialog->setTitle(pht('Already Linked to Another Account'));
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'The LDAP account you just authorized is already '.
+ $dialog->appendChild(
+ '
'.pht('The LDAP account you just authorized is already '.
'linked toanother Phabricator account. Before you can link it '.
'to a different LDAP account, you must unlink the old '.
- 'account.')));
+ 'account.').'
'
+ );
$dialog->addCancelButton('/settings/panel/ldap/');
return id(new AphrontDialogResponse())->setDialog($dialog);
@@ -61,8 +62,10 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
$dialog = new AphrontDialogView();
$dialog->setUser($current_user);
$dialog->setTitle(pht('Link LDAP Account'));
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'Link your LDAP account to your Phabricator account?')));
+ $dialog->appendChild(
+ '
'.
+ pht('Link your LDAP account to your Phabricator account?').
+ '
');
$dialog->addHiddenInput('username', $request->getStr('username'));
$dialog->addHiddenInput('password', $request->getStr('password'));
$dialog->addSubmitButton(pht('Link Accounts'));
@@ -131,10 +134,9 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
$panel = new AphrontPanelView();
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
- $panel->appendChild(phutil_tag('h1', array(), pht('LDAP login')));
+ $panel->appendChild('
'.pht('LDAP login').'
');
$panel->appendChild($ldap_form);
- $error_view = null;
if (isset($errors) && count($errors) > 0) {
$error_view = new AphrontErrorView();
$error_view->setTitle(pht('Login Failed'));
@@ -143,7 +145,7 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
return $this->buildStandardPageResponse(
array(
- $error_view,
+ isset($error_view) ? $error_view : null,
$panel,
),
array(
diff --git a/src/applications/auth/controller/PhabricatorLDAPUnlinkController.php b/src/applications/auth/controller/PhabricatorLDAPUnlinkController.php
index c2c7aaf34b..44cad5a398 100644
--- a/src/applications/auth/controller/PhabricatorLDAPUnlinkController.php
+++ b/src/applications/auth/controller/PhabricatorLDAPUnlinkController.php
@@ -18,9 +18,9 @@ final class PhabricatorLDAPUnlinkController extends PhabricatorAuthController {
$dialog = new AphrontDialogView();
$dialog->setUser($user);
$dialog->setTitle(pht('Really unlink account?'));
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'You will not be able to login using this account '.
- 'once you unlink it. Continue?')));
+ $dialog->appendChild(
+ '
'.pht('You will not be able to login using this account '.
+ 'once you unlink it. Continue?').'
');
$dialog->addSubmitButton(pht('Unlink Account'));
$dialog->addCancelButton('/settings/panel/ldap/');
diff --git a/src/applications/auth/controller/PhabricatorLoginController.php b/src/applications/auth/controller/PhabricatorLoginController.php
index f4bb0ab57a..23de5e7f2d 100644
--- a/src/applications/auth/controller/PhabricatorLoginController.php
+++ b/src/applications/auth/controller/PhabricatorLoginController.php
@@ -29,8 +29,7 @@ final class PhabricatorLoginController
$dialog = new AphrontDialogView();
$dialog->setUser($user);
$dialog->setTitle(pht('Login Required'));
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'You must login to continue.')));
+ $dialog->appendChild('
'.pht('You must login to continue.').'
');
$dialog->addSubmitButton(pht('Login'));
$dialog->addCancelButton('/', pht('Cancel'));
@@ -247,7 +246,8 @@ final class PhabricatorLoginController
$title = pht("Login or Register with %s", $provider_name);
$body = pht('Login or register for Phabricator using your %s account.',
$provider_name);
- $button = pht("Login or Register with %s", $provider_name);
+ $button = pht("Login or Register with %s",
+ phutil_escape_html($provider_name));
} else {
$title = pht("Login with %s", $provider_name);
$body = hsprintf(
@@ -258,7 +258,7 @@ final class PhabricatorLoginController
pht(
'You can not use %s to register a new account.',
$provider_name));
- $button = pht("Log in with %s", $provider_name);
+ $button = pht("Log in with %s", phutil_escape_html($provider_name));
}
$auth_form = new AphrontFormView();
@@ -299,7 +299,7 @@ final class PhabricatorLoginController
return $this->buildApplicationPage(
array(
$error_view,
- phutil_safe_html($login_message),
+ $login_message,
$panel,
),
array(
diff --git a/src/applications/auth/controller/PhabricatorLoginValidateController.php b/src/applications/auth/controller/PhabricatorLoginValidateController.php
index 04b08b43f4..a365618bd8 100644
--- a/src/applications/auth/controller/PhabricatorLoginValidateController.php
+++ b/src/applications/auth/controller/PhabricatorLoginValidateController.php
@@ -49,18 +49,14 @@ final class PhabricatorLoginValidateController
$view = new AphrontRequestFailureView();
$view->setHeader(pht('Login Failed'));
- $view->appendChild(hsprintf(
- '
%s
%s
%s
',
- pht('Login failed:'),
- $list,
- pht(
- 'Clear your cookies and try again.',
- hsprintf(''))));
- $view->appendChild(hsprintf(
+ $view->appendChild(
+ '
',
- pht('Try Again')));
+ ''.pht('Try Again').''.
+ '');
return $this->buildStandardPageResponse(
$view,
array(
diff --git a/src/applications/auth/controller/PhabricatorLogoutController.php b/src/applications/auth/controller/PhabricatorLogoutController.php
index f75b4c601d..e2cc5410fa 100644
--- a/src/applications/auth/controller/PhabricatorLogoutController.php
+++ b/src/applications/auth/controller/PhabricatorLogoutController.php
@@ -46,8 +46,7 @@ final class PhabricatorLogoutController
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle(pht('Log out of Phabricator?'))
- ->appendChild(phutil_tag('p', array(), pht(
- 'Are you sure you want to log out?')))
+ ->appendChild('
'.pht('Are you sure you want to log out?').'
')
->addSubmitButton(pht('Logout'))
->addCancelButton('/');
diff --git a/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php b/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
index 67a253b406..b08f7432cc 100644
--- a/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
+++ b/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
@@ -41,26 +41,31 @@ final class PhabricatorMustVerifyEmailController
$error_view = new AphrontRequestFailureView();
$error_view->setHeader(pht('Check Your Email'));
- $error_view->appendChild(phutil_tag('p', array(), pht(
- 'You must verify your email address to login. You should have a new '.
+ $error_view->appendChild(
+ '
'.
+ pht('You must verify your email address to login. You should have a new '.
'email message from Phabricator with verification instructions in your '.
- 'inbox (%s).', phutil_tag('strong', array(), $email_address))));
- $error_view->appendChild(phutil_tag('p', array(), pht(
- 'If you did not receive an email, you can click the button below '.
- 'to try sending another one.')));
- $error_view->appendChild(hsprintf(
- '
These tests may be able to '.
- 'help diagnose the root cause of problems you experience with %s '.
- 'Authentication. Reload the page to run the tests again.
',
- $provider->getProviderName()));
+ 'help diagnose the root cause of problems you experience with '.
+ $provider->getProviderName() .
+ ' Authentication. Reload the page to run the tests again.');
$panel_view->appendChild($table_view);
return $this->buildStandardPageResponse(
diff --git a/src/applications/auth/controller/PhabricatorOAuthLoginController.php b/src/applications/auth/controller/PhabricatorOAuthLoginController.php
index a226f5e9cf..dbfcc81810 100644
--- a/src/applications/auth/controller/PhabricatorOAuthLoginController.php
+++ b/src/applications/auth/controller/PhabricatorOAuthLoginController.php
@@ -116,9 +116,10 @@ final class PhabricatorOAuthLoginController
$dialog = new AphrontDialogView();
$dialog->setUser($current_user);
$dialog->setTitle(pht('Link %s Account', $provider_name));
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'Link your %s account to your Phabricator account?',
- $provider_name)));
+ $dialog->appendChild(
+ pht(
+ '
Link your %s account to your Phabricator account?
',
+ phutil_escape_html($provider_name)));
$dialog->addHiddenInput('confirm_token', $provider->getAccessToken());
$dialog->addHiddenInput('expires', $oauth_info->getTokenExpires());
$dialog->addHiddenInput('state', $this->oauthState);
diff --git a/src/applications/auth/controller/PhabricatorOAuthUnlinkController.php b/src/applications/auth/controller/PhabricatorOAuthUnlinkController.php
index 97be2b7b8c..bff01b251b 100644
--- a/src/applications/auth/controller/PhabricatorOAuthUnlinkController.php
+++ b/src/applications/auth/controller/PhabricatorOAuthUnlinkController.php
@@ -34,9 +34,9 @@ final class PhabricatorOAuthUnlinkController extends PhabricatorAuthController {
$dialog = new AphrontDialogView();
$dialog->setUser($user);
$dialog->setTitle(pht('Really unlink account?'));
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'You will not be able to login using this account '.
- 'once you unlink it. Continue?')));
+ $dialog->appendChild(
+ '
'.pht('You will not be able to login using this account '.
+ 'once you unlink it. Continue?').'
'));
+ '');
$utils->setWidth(AphrontPanelView::WIDTH_FULL);
$this->setShowSideNav(false);
diff --git a/src/applications/conduit/controller/PhabricatorConduitLogController.php b/src/applications/conduit/controller/PhabricatorConduitLogController.php
index c752714dda..a6bcbf74d7 100644
--- a/src/applications/conduit/controller/PhabricatorConduitLogController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitLogController.php
@@ -65,9 +65,9 @@ final class PhabricatorConduitLogController
}
$rows[] = array(
$call->getConnectionID(),
- $conn->getUserName(),
- $call->getMethod(),
- $call->getError(),
+ phutil_escape_html($conn->getUserName()),
+ phutil_escape_html($call->getMethod()),
+ phutil_escape_html($call->getError()),
number_format($call->getDuration()).' us',
phabricator_datetime($call->getDateCreated(), $user),
);
diff --git a/src/applications/config/controller/PhabricatorConfigAllController.php b/src/applications/config/controller/PhabricatorConfigAllController.php
index 69daa9a760..60f95b2263 100644
--- a/src/applications/config/controller/PhabricatorConfigAllController.php
+++ b/src/applications/config/controller/PhabricatorConfigAllController.php
@@ -14,12 +14,13 @@ final class PhabricatorConfigAllController
$key = $option->getKey();
if ($option->getMasked()) {
- $value = phutil_tag('em', array(), pht('Masked'));
+ $value = ''.pht('Masked').'';
} else if ($option->getHidden()) {
- $value = phutil_tag('em', array(), pht('Hidden'));
+ $value = ''.pht('Hidden').'';
} else {
$value = PhabricatorEnv::getEnvConfig($key);
$value = PhabricatorConfigJSON::prettyPrintJSON($value);
+ $value = phutil_escape_html($value);
}
$rows[] = array(
diff --git a/src/applications/config/response/PhabricatorConfigResponse.php b/src/applications/config/response/PhabricatorConfigResponse.php
index 923313bb2a..479df39cd1 100644
--- a/src/applications/config/response/PhabricatorConfigResponse.php
+++ b/src/applications/config/response/PhabricatorConfigResponse.php
@@ -23,18 +23,20 @@ final class PhabricatorConfigResponse extends AphrontHTMLResponse {
$view = $this->view->render();
- return hsprintf(
- ''.
- ''.
- ''.
- ''.
- 'Phabricator Setup'.
- '%s'.
- ''.
- '%s'.
- '',
- $resources,
- $view);
+ $template = <<
+
+
+ Phabricator Setup
+ {$resources}
+
+
+ {$view}
+
+
+EOTEMPLATE;
+
+ return $template;
}
private function buildResources() {
@@ -47,12 +49,11 @@ final class PhabricatorConfigResponse extends AphrontHTMLResponse {
$resources = array();
foreach ($css as $path) {
- $resources[] = phutil_tag(
- 'style',
- array('type' => 'text/css'),
- Filesystem::readFile($webroot.'/rsrc/css/'.$path));
+ $resources[] = '';
}
- return phutil_implode_html("\n", $resources);
+ return implode("\n", $resources);
}
diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php
index 6912054f67..203a62b81b 100644
--- a/src/applications/config/view/PhabricatorSetupIssueView.php
+++ b/src/applications/config/view/PhabricatorSetupIssueView.php
@@ -44,7 +44,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
),
array(
phutil_tag('p', array(), $run_these),
- phutil_tag('pre', array(), phutil_implode_html("\n", $commands)),
+ phutil_tag('pre', array(), array_interleave("\n", $commands)),
));
}
@@ -114,7 +114,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
array(
'class' => 'setup-issue',
),
- $this->renderSingleView(
+ $this->renderHTMLView(
array(
$name,
$description,
@@ -155,7 +155,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
'phabricator/ $ ./bin/config set %s value',
$key);
}
- $update = phutil_tag('pre', array(), phutil_implode_html("\n", $update));
+ $update = phutil_tag('pre', array(), array_interleave("\n", $update));
} else {
$update = array();
foreach ($configs as $config) {
@@ -187,7 +187,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
array(
'class' => 'setup-issue-config',
),
- self::renderSingleView(
+ self::renderHTMLView(
array(
$table_info,
$table,
@@ -293,7 +293,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
array(
'class' => 'setup-issue-config',
),
- $this->renderSingleView(
+ $this->renderHTMLView(
array(
$table_info,
$table,
diff --git a/src/applications/conpherence/controller/ConpherenceController.php b/src/applications/conpherence/controller/ConpherenceController.php
index 67fecfe264..006049b9c7 100644
--- a/src/applications/conpherence/controller/ConpherenceController.php
+++ b/src/applications/conpherence/controller/ConpherenceController.php
@@ -159,7 +159,8 @@ abstract class ConpherenceController extends PhabricatorController {
$item->addClass('hide-unread-count');
}
- $nav->addCustomBlock($item->render());
+ // TODO: [HTML] Clean this up when we clean up HTML stuff in Conpherence.
+ $nav->addCustomBlock(phutil_safe_html($item->render()));
}
if (empty($conpherences) || $read) {
$nav->addCustomBlock($this->getNoConpherencesBlock());
diff --git a/src/applications/conpherence/controller/ConpherenceViewController.php b/src/applications/conpherence/controller/ConpherenceViewController.php
index 65eee271f9..66f80ba133 100644
--- a/src/applications/conpherence/controller/ConpherenceViewController.php
+++ b/src/applications/conpherence/controller/ConpherenceViewController.php
@@ -149,7 +149,7 @@ final class ConpherenceViewController extends
->setMarkupEngine($engine)
->render();
}
- $transactions = phutil_implode_html(' ', $rendered_transactions);
+ $transactions = implode(' ', $rendered_transactions);
$form =
id(new AphrontFormView())
@@ -283,7 +283,7 @@ final class ConpherenceViewController extends
'src' => $thumb
),
''),
- $file->getName(),
+ phutil_escape_html($file->getName()),
);
}
$header = id(new PhabricatorHeaderView())
@@ -292,7 +292,7 @@ final class ConpherenceViewController extends
->setNoDataString(pht('No files attached to conpherence.'))
->setHeaders(array('', pht('Name')))
->setColumnClasses(array('', 'wide'));
- return hsprintf('%s%s', $header->render(), $table->render());
+ return new PhutilSafeHTML($header->render() . $table->render());
}
private function renderTaskWidgetPaneContent() {
@@ -328,7 +328,7 @@ final class ConpherenceViewController extends
->setColumnClasses(array('', 'wide'));
$content[] = $table->render();
}
- return phutil_implode_html('', $content);
+ return new PhutilSafeHTML(implode('', $content));
}
private function renderCalendarWidgetPaneContent() {
@@ -416,7 +416,7 @@ final class ConpherenceViewController extends
}
}
- return phutil_implode_html('', $content);
+ return new PhutilSafeHTML(implode('', $content));
}
private function getCalendarWidgetWeekTimestamps() {
diff --git a/src/applications/conpherence/storage/ConpherenceTransaction.php b/src/applications/conpherence/storage/ConpherenceTransaction.php
index b2ff0f97c0..64afcf9157 100644
--- a/src/applications/conpherence/storage/ConpherenceTransaction.php
+++ b/src/applications/conpherence/storage/ConpherenceTransaction.php
@@ -50,18 +50,18 @@ final class ConpherenceTransaction extends PhabricatorApplicationTransaction {
$title = pht(
'%s renamed this conpherence from "%s" to "%s".',
$this->renderHandleLink($author_phid),
- $old,
- $new);
+ phutil_escape_html($old),
+ phutil_escape_html($new));
} else if ($old) {
$title = pht(
'%s deleted the conpherence name "%s".',
$this->renderHandleLink($author_phid),
- $old);
+ phutil_escape_html($old));
} else {
$title = pht(
'%s named this conpherence "%s".',
$this->renderHandleLink($author_phid),
- $new);
+ phutil_escape_html($new));
}
return $title;
case ConpherenceTransactionType::TYPE_FILES:
diff --git a/src/applications/conpherence/view/ConpherenceMenuItemView.php b/src/applications/conpherence/view/ConpherenceMenuItemView.php
index 539a107122..c69d7c502d 100644
--- a/src/applications/conpherence/view/ConpherenceMenuItemView.php
+++ b/src/applications/conpherence/view/ConpherenceMenuItemView.php
@@ -139,7 +139,7 @@ final class ConpherenceMenuItemView extends AphrontTagView {
(int)$this->unreadCount);
}
- return $this->renderSingleView(
+ return $this->renderHTMLView(
array(
$image,
$title,
diff --git a/src/applications/conpherence/view/ConpherenceTransactionView.php b/src/applications/conpherence/view/ConpherenceTransactionView.php
index 13238c04ec..2d785dc225 100644
--- a/src/applications/conpherence/view/ConpherenceTransactionView.php
+++ b/src/applications/conpherence/view/ConpherenceTransactionView.php
@@ -87,7 +87,7 @@ final class ConpherenceTransactionView extends AphrontView {
array(
'class' => $content_class
),
- $this->renderSingleView($content))
+ $this->renderHTMLView($content))
);
return $transaction_view->render();
diff --git a/src/applications/countdown/controller/PhabricatorCountdownListController.php b/src/applications/countdown/controller/PhabricatorCountdownListController.php
index b503d241d3..93e4a916b7 100644
--- a/src/applications/countdown/controller/PhabricatorCountdownListController.php
+++ b/src/applications/countdown/controller/PhabricatorCountdownListController.php
@@ -46,7 +46,7 @@ final class PhabricatorCountdownListController
'Delete');
}
$rows[] = array(
- $timer->getID(),
+ phutil_escape_html($timer->getID()),
$handles[$timer->getAuthorPHID()]->renderLink(),
phutil_tag(
'a',
diff --git a/src/applications/daemon/controller/PhabricatorDaemonConsoleController.php b/src/applications/daemon/controller/PhabricatorDaemonConsoleController.php
index f9a6d4615b..26059e4ce2 100644
--- a/src/applications/daemon/controller/PhabricatorDaemonConsoleController.php
+++ b/src/applications/daemon/controller/PhabricatorDaemonConsoleController.php
@@ -30,7 +30,7 @@ final class PhabricatorDaemonConsoleController
$rows = array();
foreach ($completed_info as $class => $info) {
$rows[] = array(
- $class,
+ phutil_escape_html($class),
number_format($info['n']),
number_format((int)($info['duration'] / $info['n'])).' us',
);
@@ -127,7 +127,7 @@ final class PhabricatorDaemonConsoleController
$rows = array();
foreach ($queued as $row) {
$rows[] = array(
- $row['taskClass'],
+ phutil_escape_html($row['taskClass']),
number_format($row['N']),
);
}
diff --git a/src/applications/daemon/controller/PhabricatorWorkerTaskUpdateController.php b/src/applications/daemon/controller/PhabricatorWorkerTaskUpdateController.php
index 811ef354be..72f9e256aa 100644
--- a/src/applications/daemon/controller/PhabricatorWorkerTaskUpdateController.php
+++ b/src/applications/daemon/controller/PhabricatorWorkerTaskUpdateController.php
@@ -72,40 +72,41 @@ final class PhabricatorWorkerTaskUpdateController
case 'retry':
if ($can_retry) {
$dialog->setTitle('Really retry task?');
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'The task will be put back in the queue and executed again.')));
+ $dialog->appendChild(
+ '
The task will be put back in the queue and executed '.
+ 'again.
');
$dialog->addSubmitButton('Retry Task');
} else {
$dialog->setTitle('Can Not Retry');
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'Only archived, unsuccessful tasks can be retried.')));
+ $dialog->appendChild(
+ '
Only archived, unsuccessful tasks can be retried.
');
}
break;
case 'cancel':
if ($can_cancel) {
$dialog->setTitle('Really cancel task?');
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'The work this task represents will never be performed if you '.
- 'cancel it. Are you sure you want to cancel it?')));
+ $dialog->appendChild(
+ '
The work this task represents will never be performed if you '.
+ 'cancel it. Are you sure you want to cancel it?
');
$dialog->addSubmitButton('Cancel Task');
} else {
$dialog->setTitle('Can Not Cancel');
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'Only active tasks can be cancelled.')));
+ $dialog->appendChild(
+ '
Only active tasks can be cancelled.
');
}
break;
case 'release':
if ($can_release) {
$dialog->setTitle('Really free task lease?');
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'If the process which owns the task lease is still doing work '.
+ $dialog->appendChild(
+ '
If the process which owns the task lease is still doing work '.
'on it, the work may be performed twice. Are you sure you '.
- 'want to free the lease?')));
+ 'want to free the lease?
');
$dialog->addSubmitButton('Free Lease');
} else {
$dialog->setTitle('Can Not Free Lease');
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'Only active, leased tasks may have their leases freed.')));
+ $dialog->appendChild(
+ '
Only active, leased tasks may have their leases freed.
');
}
break;
default:
diff --git a/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php b/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php
index 600dc50e14..e3cdc98779 100644
--- a/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php
+++ b/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php
@@ -60,7 +60,7 @@ final class PhabricatorDaemonLogEventsView extends AphrontView {
}
$row = array(
- $event->getLogType(),
+ phutil_escape_html($event->getLogType()),
phabricator_date($event->getEpoch(), $this->user),
phabricator_time($event->getEpoch(), $this->user),
phutil_escape_html_newlines($message.$more),
diff --git a/src/applications/daemon/view/PhabricatorDaemonLogListView.php b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
index 47353b948f..190e17c3cd 100644
--- a/src/applications/daemon/view/PhabricatorDaemonLogListView.php
+++ b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
@@ -76,8 +76,8 @@ final class PhabricatorDaemonLogListView extends AphrontView {
$rows[] = array(
$running,
- $log->getDaemon(),
- $log->getHost(),
+ phutil_escape_html($log->getDaemon()),
+ phutil_escape_html($log->getHost()),
$log->getPID(),
phabricator_date($epoch, $this->user),
phabricator_time($epoch, $this->user),
diff --git a/src/applications/differential/controller/DifferentialCommentSaveController.php b/src/applications/differential/controller/DifferentialCommentSaveController.php
index 6f84e33282..d49232bb37 100644
--- a/src/applications/differential/controller/DifferentialCommentSaveController.php
+++ b/src/applications/differential/controller/DifferentialCommentSaveController.php
@@ -60,9 +60,10 @@ final class DifferentialCommentSaveController extends DifferentialController {
if (strlen($comment) || $has_inlines) {
$dialog->addSubmitButton(pht('Post as Comment'));
- $dialog->appendChild(phutil_tag('br'));
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'Do you want to post your feedback anyway, as a normal comment?')));
+ $dialog->appendChild(' ');
+ $dialog->appendChild(
+ '
'.pht('Do you want to post your feedback anyway, as a normal '.
+ 'comment?').'
',
- pht(
- 'Review the diff for correctness. When you are satisfied, either '.
- 'create a new revision or update '.
- 'an existing revision.',
- hsprintf(''))));
+ $action_panel->appendChild(
+ '
'.pht('Review the diff for '.
+ 'correctness. When you are satisfied, either create a new '.
+ 'revision or update an existing revision.'));
// TODO: implmenent optgroup support in AphrontFormSelectControl?
$select = array();
diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
index 546a173607..1e572ab334 100644
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -386,15 +386,14 @@ final class DifferentialRevisionViewController extends DifferentialController {
$page_pane = id(new DifferentialPrimaryPaneView())
->setID($pane_id)
- ->appendChild(array(
- $comment_view->render(),
- $diff_history->render(),
- $warning,
- $local_view->render(),
- $toc_view->render(),
- $other_view,
- $changeset_view->render(),
- ));
+ ->appendChild(
+ $comment_view->render().
+ $diff_history->render().
+ $warning.
+ $local_view->render().
+ $toc_view->render().
+ $other_view.
+ $changeset_view->render());
if ($comment_form) {
$page_pane->appendChild($comment_form->render());
}
@@ -858,12 +857,13 @@ final class DifferentialRevisionViewController extends DifferentialController {
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
- return hsprintf(
- '%s
';
$n_colspan--;
}
@@ -242,7 +242,7 @@ final class DifferentialChangesetTwoUpRenderer
$n_classes = $n_class;
if ($new_lines[$ii]['type'] == '\\' || !isset($copy_lines[$n_num])) {
- $n_copy = hsprintf('
', $n_class);
+ $n_copy = '
';
} else {
list($orig_file, $orig_line, $orig_type) = $copy_lines[$n_num];
$title = ($orig_type == '-' ? 'Moved' : 'Copied').' from ';
@@ -274,13 +274,13 @@ final class DifferentialChangesetTwoUpRenderer
}
if ($o_num && $left_id) {
- $o_id = 'C'.$left_id.$left_char.'L'.$o_num;
+ $o_id = ' id="C'.$left_id.$left_char.'L'.$o_num.'"';
} else {
$o_id = null;
}
if ($n_num && $right_id) {
- $n_id = 'C'.$right_id.$right_char.'L'.$n_num;
+ $n_id = ' id="C'.$right_id.$right_char.'L'.$n_num.'"';
} else {
$n_id = null;
}
@@ -288,26 +288,20 @@ final class DifferentialChangesetTwoUpRenderer
// NOTE: The Javascript is sensitive to whitespace changes in this
// block!
- $html[] = hsprintf(
+ $html[] =
'
'.
- '%s'.
- '
%s
'.
- '%s'.
- '%s'.
+ '
'.$o_num.'
'.
+ '
'.$o_text.'
'.
+ '
'.$n_num.'
'.
+ $n_copy.
// NOTE: This is a unicode zero-width space, which we use as a hint
// when intercepting 'copy' events to make sure sensible text ends
// up on the clipboard. See the 'phabricator-oncopy' behavior.
- '
')
->addCancelButton($lease_uri);
return id(new AphrontDialogResponse())->setDialog($dialog);
@@ -35,10 +35,11 @@ final class DrydockLeaseReleaseController extends DrydockController {
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle(pht('Really release lease?'))
- ->appendChild(phutil_tag('p', array(), pht(
- 'Releasing a lease may cause trouble for the lease holder and '.
- 'trigger cleanup of the underlying resource. It can not be '.
- 'undone. Continue?')))
+ ->appendChild(
+ '
'.pht(
+ 'Releasing a lease may cause trouble for the lease holder and '.
+ 'trigger cleanup of the underlying resource. It can not be '.
+ 'undone. Continue?').'
')
->addSubmitButton(pht('Release Lease'))
->addCancelButton($lease_uri);
diff --git a/src/applications/drydock/controller/DrydockResourceCloseController.php b/src/applications/drydock/controller/DrydockResourceCloseController.php
index 8b28ce0319..94ac736b78 100644
--- a/src/applications/drydock/controller/DrydockResourceCloseController.php
+++ b/src/applications/drydock/controller/DrydockResourceCloseController.php
@@ -24,8 +24,8 @@ final class DrydockResourceCloseController extends DrydockController {
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle(pht('Resource Not Open'))
- ->appendChild(phutil_tag('p', array(), pht(
- 'You can only close "open" resources.')))
+ ->appendChild(
+ '
'.pht('You can only close "open" resources.').'
')
->addCancelButton($resource_uri);
return id(new AphrontDialogResponse())->setDialog($dialog);
@@ -35,9 +35,10 @@ final class DrydockResourceCloseController extends DrydockController {
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle(pht('Really close resource?'))
- ->appendChild(phutil_tag('p', array(), pht(
- 'Closing a resource releases all leases and destroys the '.
- 'resource. It can not be undone. Continue?')))
+ ->appendChild(
+ '
'.pht(
+ 'Closing a resource releases all leases and destroys the '.
+ 'resource. It can not be undone. Continue?').'
')
->addSubmitButton(pht('Close Resource'))
->addCancelButton($resource_uri);
diff --git a/src/applications/fact/controller/PhabricatorFactHomeController.php b/src/applications/fact/controller/PhabricatorFactHomeController.php
index 342edb7fa3..82ce96baa1 100644
--- a/src/applications/fact/controller/PhabricatorFactHomeController.php
+++ b/src/applications/fact/controller/PhabricatorFactHomeController.php
@@ -32,7 +32,10 @@ final class PhabricatorFactHomeController extends PhabricatorFactController {
$name = $spec->getName();
$value = $spec->formatValueForDisplay($user, $fact->getValueX());
- $rows[] = array($name, $value);
+ $rows[] = array(
+ phutil_escape_html($name),
+ phutil_escape_html($value),
+ );
}
$table = new AphrontTableView($rows);
diff --git a/src/applications/feed/builder/PhabricatorFeedBuilder.php b/src/applications/feed/builder/PhabricatorFeedBuilder.php
index 9803fd51e1..dfb9751cf8 100644
--- a/src/applications/feed/builder/PhabricatorFeedBuilder.php
+++ b/src/applications/feed/builder/PhabricatorFeedBuilder.php
@@ -40,8 +40,8 @@ final class PhabricatorFeedBuilder {
if ($date !== $last_date) {
if ($last_date !== null) {
- $null_view->appendChild(hsprintf(
- ''));
+ $null_view->appendChild(
+ '');
}
$last_date = $date;
$null_view->appendChild(
@@ -59,9 +59,10 @@ final class PhabricatorFeedBuilder {
$null_view->appendChild($view);
}
- return id(new AphrontNullView())->appendChild(hsprintf(
- '
'.pht('Really disable the much-beloved image macro %s? '.
+ 'It will be sorely missed.', phutil_escape_html($macro->getName())).
+ '
')
->setSubmitURI($this->getApplicationURI('/disable/'.$this->id.'/'))
->addSubmitButton(pht('Disable'))
->addCancelButton($view_uri);
diff --git a/src/applications/macro/controller/PhabricatorMacroViewController.php b/src/applications/macro/controller/PhabricatorMacroViewController.php
index 94e0c4691f..770ae16a1c 100644
--- a/src/applications/macro/controller/PhabricatorMacroViewController.php
+++ b/src/applications/macro/controller/PhabricatorMacroViewController.php
@@ -147,7 +147,7 @@ final class PhabricatorMacroViewController
foreach ($subscribers as $subscriber) {
$sub_view[] = $this->getHandle($subscriber)->renderLink();
}
- $sub_view = phutil_implode_html(', ', $sub_view);
+ $sub_view = array_interleave(', ', $sub_view);
} else {
$sub_view = phutil_tag('em', array(), pht('None'));
}
diff --git a/src/applications/macro/storage/PhabricatorMacroTransaction.php b/src/applications/macro/storage/PhabricatorMacroTransaction.php
index bd0ac70c49..5711d7899e 100644
--- a/src/applications/macro/storage/PhabricatorMacroTransaction.php
+++ b/src/applications/macro/storage/PhabricatorMacroTransaction.php
@@ -64,8 +64,8 @@ final class PhabricatorMacroTransaction
return pht(
'%s renamed this macro from "%s" to "%s".',
$this->renderHandleLink($author_phid),
- $old,
- $new);
+ phutil_escape_html($old),
+ phutil_escape_html($new));
break;
case PhabricatorMacroTransactionType::TYPE_DISABLED:
if ($new) {
@@ -109,8 +109,8 @@ final class PhabricatorMacroTransaction
'%s renamed %s from "%s" to "%s".',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid),
- $old,
- $new);
+ phutil_escape_html($old),
+ phutil_escape_html($new));
case PhabricatorMacroTransactionType::TYPE_DISABLED:
if ($new) {
return pht(
diff --git a/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php b/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php
index f5670b4895..c675d4b30b 100644
--- a/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php
+++ b/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php
@@ -31,8 +31,8 @@ final class PhabricatorMailingListsListController
$rows = array();
foreach ($lists as $list) {
$rows[] = array(
- $list->getName(),
- $list->getEmail(),
+ phutil_escape_html($list->getName()),
+ phutil_escape_html($list->getEmail()),
phutil_tag(
'a',
array(
diff --git a/src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldDefaultSpecification.php b/src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldDefaultSpecification.php
index 15058a7302..b393a6e1de 100644
--- a/src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldDefaultSpecification.php
+++ b/src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldDefaultSpecification.php
@@ -152,13 +152,13 @@ class ManiphestAuxiliaryFieldDefaultSpecification
switch ($this->getFieldType()) {
case self::TYPE_BOOL:
if ($this->getValue()) {
- return $this->getCheckboxValue();
+ return phutil_escape_html($this->getCheckboxValue());
} else {
return null;
}
case self::TYPE_SELECT:
$display = idx($this->getSelectOptions(), $this->getValue());
- return $display;
+ return phutil_escape_html($display);
}
return parent::renderForDetailView();
}
@@ -203,6 +203,10 @@ class ManiphestAuxiliaryFieldDefaultSpecification
break;
}
+ if ($target == self::RENDER_TARGET_HTML) {
+ $desc = phutil_escape_html($desc);
+ }
+
return $desc;
}
diff --git a/src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldSpecification.php b/src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldSpecification.php
index 216227194d..fba027e838 100644
--- a/src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldSpecification.php
+++ b/src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldSpecification.php
@@ -71,7 +71,7 @@ abstract class ManiphestAuxiliaryFieldSpecification {
}
public function renderForDetailView() {
- return $this->getValue();
+ return phutil_escape_html($this->getValue());
}
diff --git a/src/applications/maniphest/controller/ManiphestExportController.php b/src/applications/maniphest/controller/ManiphestExportController.php
index a33809b745..591e8ff310 100644
--- a/src/applications/maniphest/controller/ManiphestExportController.php
+++ b/src/applications/maniphest/controller/ManiphestExportController.php
@@ -28,7 +28,7 @@ final class ManiphestExportController extends ManiphestController {
$dialog->setUser($user);
$dialog->setTitle('Excel Export Not Configured');
- $dialog->appendChild(hsprintf(
+ $dialog->appendChild(
'
This system does not have PHPExcel installed. This software '.
'component is required to export tasks to Excel. Have your system '.
'administrator install it from:
'.
@@ -38,7 +38,7 @@ final class ManiphestExportController extends ManiphestController {
''.
' '.
'
Your PHP "include_path" needs to be updated to include the '.
- 'PHPExcel Classes/ directory.
'));
+ 'PHPExcel Classes/ directory.');
$dialog->addCancelButton('/maniphest/');
return id(new AphrontDialogResponse())->setDialog($dialog);
@@ -59,8 +59,8 @@ final class ManiphestExportController extends ManiphestController {
$dialog->setUser($user);
$dialog->setTitle('Export Tasks to Excel');
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'Do you want to export the query results to Excel?')));
+ $dialog->appendChild(
+ '
Do you want to export the query results to Excel?
');
$dialog->addCancelButton('/maniphest/');
$dialog->addSubmitButton('Export to Excel');
diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php
index 229ba2e1f4..34c2b30494 100644
--- a/src/applications/maniphest/controller/ManiphestReportController.php
+++ b/src/applications/maniphest/controller/ManiphestReportController.php
@@ -244,7 +244,7 @@ final class ManiphestReportController extends ManiphestController {
));
if ($handle) {
- $header = pht("Task Burn Rate for Project %s", $handle->renderLink());
+ $header = "Task Burn Rate for Project ".$handle->renderLink();
$caption = hsprintf(
"
NOTE: This table reflects tasks currently in ".
"the project. If a task was opened in the past but added to ".
@@ -363,9 +363,9 @@ final class ManiphestReportController extends ManiphestController {
$fmt = number_format($delta);
if ($delta > 0) {
$fmt = '+'.$fmt;
- $fmt = hsprintf('%s', $fmt);
+ $fmt = ''.$fmt.'';
} else {
- $fmt = hsprintf('%s', $fmt);
+ $fmt = ''.$fmt.'';
}
return array(
diff --git a/src/applications/maniphest/controller/ManiphestSavedQueryListController.php b/src/applications/maniphest/controller/ManiphestSavedQueryListController.php
index 2f80e6028d..d6377c10b7 100644
--- a/src/applications/maniphest/controller/ManiphestSavedQueryListController.php
+++ b/src/applications/maniphest/controller/ManiphestSavedQueryListController.php
@@ -81,7 +81,7 @@ final class ManiphestSavedQueryListController extends ManiphestController {
'value' => 0,
'checked' => ($default === null ? 'checked' : null),
)),
- phutil_tag('em', array(), 'No Default'),
+ 'No Default',
'',
'',
);
@@ -111,7 +111,7 @@ final class ManiphestSavedQueryListController extends ManiphestController {
'Save Default Query'));
$panel->appendChild($table);
- $form = phabricator_form(
+ $form = phabricator_render_form(
$user,
array(
'method' => 'POST',
diff --git a/src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php b/src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php
index ee185362c5..64fa264dc8 100644
--- a/src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php
@@ -18,9 +18,10 @@ final class ManiphestTaskDescriptionPreviewController
ManiphestTask::MARKUP_FIELD_DESCRIPTION,
$request->getUser());
- $content = hsprintf(
- '
';
$header->appendChild($content);
if ($user->getPHID() == $viewer->getPHID()) {
@@ -172,11 +172,13 @@ final class PhabricatorPeopleProfileController
$blurb = nonempty(
$profile->getBlurb(),
- '//'.pht('Nothing is known about this rare specimen.').'//'
+ '//'.
+ pht('Nothing is known about this rare specimen.')
+ .'//'
);
$engine = PhabricatorMarkupEngine::newProfileMarkupEngine();
- $blurb = $engine->markupText($blurb);
+ $blurb = phutil_safe_html($engine->markupText($blurb));
$viewer = $this->getRequest()->getUser();
@@ -230,11 +232,12 @@ final class PhabricatorPeopleProfileController
$builder->setUser($viewer);
$view = $builder->buildView();
- return hsprintf(
+ return
'
Activity Feed
-
%s
-
',
- $view->render());
+
+ '.$view->render().'
+
+
';
}
}
diff --git a/src/applications/phame/controller/blog/PhameBlogDeleteController.php b/src/applications/phame/controller/blog/PhameBlogDeleteController.php
index e6d9b4dff6..eb6f4695a8 100644
--- a/src/applications/phame/controller/blog/PhameBlogDeleteController.php
+++ b/src/applications/phame/controller/blog/PhameBlogDeleteController.php
@@ -41,7 +41,7 @@ final class PhameBlogDeleteController extends PhameController {
->appendChild(
pht(
'Really delete the blog "%s"? It will be gone forever.',
- $blog->getName()))
+ phutil_escape_html($blog->getName())))
->addSubmitButton(pht('Delete'))
->addCancelButton($cancel_uri);
diff --git a/src/applications/phame/controller/post/PhamePostDeleteController.php b/src/applications/phame/controller/post/PhamePostDeleteController.php
index 8faa715a5e..26719ff61c 100644
--- a/src/applications/phame/controller/post/PhamePostDeleteController.php
+++ b/src/applications/phame/controller/post/PhamePostDeleteController.php
@@ -41,7 +41,7 @@ final class PhamePostDeleteController extends PhameController {
->appendChild(
pht(
'Really delete the post "%s"? It will be gone forever.',
- $post->getTitle()))
+ phutil_escape_html($post->getTitle())))
->addSubmitButton(pht('Delete'))
->addCancelButton($cancel_uri);
diff --git a/src/applications/phame/controller/post/PhamePostEditController.php b/src/applications/phame/controller/post/PhamePostEditController.php
index 9af5a98b43..20217edc51 100644
--- a/src/applications/phame/controller/post/PhamePostEditController.php
+++ b/src/applications/phame/controller/post/PhamePostEditController.php
@@ -148,7 +148,7 @@ final class PhamePostEditController
->setValue($submit_button)
);
- $preview_panel = hsprintf(
+ $preview_panel =
'
Post Preview
@@ -158,7 +158,7 @@ final class PhamePostEditController
Loading preview...
- ');
+ ';
require_celerity_resource('phame-css');
Javelin::initBehavior(
diff --git a/src/applications/phame/controller/post/PhamePostNotLiveController.php b/src/applications/phame/controller/post/PhamePostNotLiveController.php
index 885bc3b1a9..c2b4983736 100644
--- a/src/applications/phame/controller/post/PhamePostNotLiveController.php
+++ b/src/applications/phame/controller/post/PhamePostNotLiveController.php
@@ -25,16 +25,16 @@ final class PhamePostNotLiveController extends PhameController {
$reasons = array();
if (!$post->getBlog()) {
- $reasons[] = phutil_tag('p', array(), pht(
- 'You can not view the live version of this post because it '.
+ $reasons[] =
+ '
'.pht('You can not view the live version of this post because it '.
'is not associated with a blog. Move the post to a blog in order to '.
- 'view it live.'));
+ 'view it live.').'
';
}
if ($post->isDraft()) {
- $reasons[] = phutil_tag('p', array(), pht(
- 'You can not view the live version of this post because it '.
- 'is still a draft. Use "Preview/Publish" to publish the post.'));
+ $reasons[] =
+ '
'.pht('You can not view the live version of this post because it '.
+ 'is still a draft. Use "Preview/Publish" to publish the post.').'