diff --git a/src/aphront/console/plugin/DarkConsoleServicesPlugin.php b/src/aphront/console/plugin/DarkConsoleServicesPlugin.php index 442ca9db4c..29e7c50d21 100644 --- a/src/aphront/console/plugin/DarkConsoleServicesPlugin.php +++ b/src/aphront/console/plugin/DarkConsoleServicesPlugin.php @@ -211,13 +211,12 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin { $info = wordwrap($info, 128, "\n", true); if (!empty($row['explain'])) { - $analysis = phutil_escape_html($row['explain']['reason']); - $analysis = phutil_render_tag( + $analysis = phutil_tag( 'span', array( 'class' => 'explain-sev-'.$row['explain']['sev'], ), - $analysis); + $row['explain']['reason']); } $info = phutil_escape_html($info); diff --git a/src/aphront/response/AphrontRedirectResponse.php b/src/aphront/response/AphrontRedirectResponse.php index bb34a97d5b..254073390d 100644 --- a/src/aphront/response/AphrontRedirectResponse.php +++ b/src/aphront/response/AphrontRedirectResponse.php @@ -42,12 +42,12 @@ class AphrontRedirectResponse extends AphrontResponse { $error->setSeverity(AphrontErrorView::SEVERITY_NOTICE); $error->setTitle('Stopped on Redirect'); - $link = phutil_render_tag( + $link = phutil_tag( 'a', array( 'href' => $this->getURI(), ), - 'Continue to: '.phutil_escape_html($this->getURI())); + 'Continue to: '.$this->getURI()); $error->appendChild( '
You were stopped here because debug.stop-on-redirect '. diff --git a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php index 76f98c7eed..581d3544ae 100644 --- a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php +++ b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php @@ -98,31 +98,29 @@ final class PhabricatorChatLogChannelLogController foreach ($blocks as $block) { $author = $block['author']; $author = phutil_utf8_shorten($author, 18); - $author = phutil_escape_html($author); - $author = phutil_render_tag('td', array('class' => 'author'), $author); + $author = phutil_tag('td', array('class' => 'author'), $author); $message = mpull($block['logs'], 'getMessage'); $message = implode("\n", $message); - $message = phutil_escape_html($message); - $message = phutil_render_tag('td', array('class' => 'message'), $message); + $message = phutil_tag('td', array('class' => 'message'), $message); $href = $uri->alter('at', $block['id']); $timestamp = $block['epoch']; $timestamp = phabricator_datetime($timestamp, $user); - $timestamp = phutil_render_tag('a', array('href' => $href), $timestamp); - $timestamp = phutil_render_tag( + $timestamp = phutil_tag('a', array('href' => $href), $timestamp); + $timestamp = phutil_tag( 'td', array( 'class' => 'timestamp', ), $timestamp); - $out[] = phutil_render_tag( + $out[] = phutil_tag( 'tr', array( 'class' => $block['class'], ), - $author.$message.$timestamp); + array($author, $message, $timestamp)); } $out[] = ''; diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php index 78b9f96e0c..c0b5dcab9f 100644 --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -132,7 +132,7 @@ final class PhabricatorConfigEditController $engine = new PhabricatorMarkupEngine(); $engine->addObject($option, 'description'); $engine->process(); - $description = phutil_render_tag( + $description = phutil_tag( 'div', array( 'class' => 'phabricator-remarkup', @@ -440,12 +440,12 @@ final class PhabricatorConfigEditController require_celerity_resource('config-options-css'); - return phutil_render_tag( + return phutil_tag( 'table', array( 'class' => 'config-option-table', ), - implode("\n", $table)); + new PhutilSafeHTML(implode("\n", $table))); } private function renderDefaults(PhabricatorConfigOption $option) { @@ -492,12 +492,12 @@ final class PhabricatorConfigEditController require_celerity_resource('config-options-css'); - return phutil_render_tag( + return phutil_tag( 'table', array( 'class' => 'config-option-table', ), - implode("\n", $table)); + new PhutilSafeHTML(implode("\n", $table))); } } diff --git a/src/applications/config/controller/PhabricatorConfigGroupController.php b/src/applications/config/controller/PhabricatorConfigGroupController.php index a41bc4efdb..2f53b30496 100644 --- a/src/applications/config/controller/PhabricatorConfigGroupController.php +++ b/src/applications/config/controller/PhabricatorConfigGroupController.php @@ -84,13 +84,15 @@ final class PhabricatorConfigGroupController $current_value = PhabricatorEnv::getEnvConfig($option->getKey()); $current_value = PhabricatorConfigJSON::prettyPrintJSON( $current_value); - $current_value = phutil_render_tag( + $current_value = phutil_tag( 'div', array( 'class' => 'config-options-current-value', ), - ''.pht('Current Value:').' '. - phutil_escape_html($current_value)); + array( + phutil_tag('span', array(), pht('Current Value:')), + ' '.$current_value, + )); $item->appendChild($current_value); } diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php index 5ac904e99a..795f124b9d 100644 --- a/src/applications/config/view/PhabricatorSetupIssueView.php +++ b/src/applications/config/view/PhabricatorSetupIssueView.php @@ -16,12 +16,12 @@ final class PhabricatorSetupIssueView extends AphrontView { public function render() { $issue = $this->getIssue(); - $description = phutil_render_tag( + $description = phutil_tag( 'div', array( 'class' => 'setup-issue-instructions', ), - nl2br(phutil_escape_html($issue->getMessage()))); + new PhutilSafeHTML(nl2br(phutil_escape_html($issue->getMessage())))); $configs = $issue->getPHPConfig(); if ($configs) { @@ -36,13 +36,15 @@ final class PhabricatorSetupIssueView extends AphrontView { $commands = $issue->getCommands(); if ($commands) { $run_these = pht("Run these %d command(s):", count($commands)); - $description .= phutil_render_tag( + $description .= phutil_tag( 'div', array( 'class' => 'setup-issue-config', ), - phutil_render_tag('p', array(), $run_these). - phutil_render_tag('pre', array(), implode("\n", $commands))); + array( + phutil_render_tag('p', array(), $run_these), + phutil_render_tag('pre', array(), implode("\n", $commands)), + )); } $extensions = $issue->getPHPExtensions(); @@ -74,17 +76,19 @@ final class PhabricatorSetupIssueView extends AphrontView { "After installing new PHP extensions, restart your webserver ". "for the changes to take effect."); - $description .= phutil_render_tag( + $description .= phutil_tag( 'div', array( 'class' => 'setup-issue-config', ), - phutil_render_tag('p', array(), $install_these). - phutil_render_tag('pre', array(), implode("\n", $extensions)). - phutil_render_tag('p', array(), $install_info). - phutil_render_tag('pre', array(), $install_commands). - phutil_render_tag('p', array(), $fallback_info). - phutil_render_tag('p', array(), $restart_info)); + array( + phutil_render_tag('p', array(), $install_these), + phutil_render_tag('pre', array(), implode("\n", $extensions)), + phutil_render_tag('p', array(), $install_info), + phutil_render_tag('pre', array(), $install_commands), + phutil_render_tag('p', array(), $fallback_info), + phutil_render_tag('p', array(), $restart_info), + )); } @@ -102,18 +106,18 @@ final class PhabricatorSetupIssueView extends AphrontView { ), $issue->getName()); - return phutil_render_tag( + return phutil_tag( 'div', array( 'class' => 'setup-issue', ), - $name.$description.$next); + array($name, $description, $next)); } private function renderPhabricatorConfig(array $configs) { $issue = $this->getIssue(); - $table_info = phutil_render_tag( + $table_info = phutil_tag( 'p', array(), pht( @@ -141,16 +145,16 @@ final class PhabricatorSetupIssueView extends AphrontView { $table[] = ''; } - $table = phutil_render_tag( + $table = phutil_tag( 'table', array( ), - implode("\n", $table)); + new PhutilSafeHTML(implode("\n", $table))); $options = PhabricatorApplicationConfigOptions::loadAllOptions(); if ($this->getIssue()->getIsFatal()) { - $update_info = phutil_render_tag( + $update_info = phutil_tag( 'p', array(), pht( @@ -172,12 +176,12 @@ final class PhabricatorSetupIssueView extends AphrontView { if (!idx($options, $config) || $options[$config]->getLocked()) { continue; } - $link = phutil_render_tag( + $link = phutil_tag( 'a', array( 'href' => '/config/edit/'.$config.'/?issue='.$issue->getIssueKey(), ), - pht('Edit %s', phutil_escape_html($config))); + pht('Edit %s', $config)); $update[] = '
'.$addview->render().' | '. '