From f8dbfdd59d514336a7039bebeb4f3486617eca50 Mon Sep 17 00:00:00 2001
From: vrana These tasks will be edited: Write something about yourself! '.
'Make sure to include important information like '.
diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php
index 7bf018a2b5..0c33b30f0f 100644
--- a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php
+++ b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php
@@ -176,12 +176,12 @@ final class PhabricatorSettingsPanelSSHKeys
$rows = array();
foreach ($keys as $key) {
$rows[] = array(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $this->getPanelURI('?edit='.$key->getID()),
),
- phutil_escape_html($key->getName())),
+ $key->getName()),
phutil_escape_html($key->getKeyComment()),
phutil_escape_html($key->getKeyType()),
phabricator_date($key->getDateCreated(), $user),
diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteListController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteListController.php
index 21ea6948be..19f16e9332 100644
--- a/src/applications/slowvote/controller/PhabricatorSlowvoteListController.php
+++ b/src/applications/slowvote/controller/PhabricatorSlowvoteListController.php
@@ -46,12 +46,12 @@ final class PhabricatorSlowvoteListController
foreach ($polls as $poll) {
$rows[] = array(
'V'.$poll->getID(),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/V'.$poll->getID(),
),
- phutil_escape_html($poll->getQuestion())),
+ $poll->getQuestion()),
$handles[$poll->getAuthorPHID()]->renderLink(),
phabricator_date($poll->getDateCreated(), $user),
phabricator_time($poll->getDateCreated(), $user),
diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
index 4331bc27aa..04c4e2e566 100644
--- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
+++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
@@ -115,12 +115,12 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView {
$preview = id(new PhabricatorTimelineView())
->setID($this->getPreviewTimelineID());
- $header = phutil_render_tag(
+ $header = phutil_tag(
'div',
array(
'class' => 'phabricator-timeline-preview-header',
),
- phutil_escape_html(pht('Preview')));
+ pht('Preview'));
return phutil_render_tag(
'div',
diff --git a/src/applications/uiexample/examples/PhabricatorBarePageExample.php b/src/applications/uiexample/examples/PhabricatorBarePageExample.php
index 5a3bf279c4..15aeb681ba 100644
--- a/src/applications/uiexample/examples/PhabricatorBarePageExample.php
+++ b/src/applications/uiexample/examples/PhabricatorBarePageExample.php
@@ -13,10 +13,10 @@ final class PhabricatorBarePageExample extends PhabricatorUIExample {
public function renderExample() {
$view = new PhabricatorBarePageView();
$view->appendChild(
- phutil_render_tag(
+ phutil_tag(
'h1',
array(),
- phutil_escape_html($this->getDescription())));
+ $this->getDescription()));
$response = new AphrontWebpageResponse();
$response->setContent($view->render());
diff --git a/src/applications/uiexample/examples/PhabricatorButtonsExample.php b/src/applications/uiexample/examples/PhabricatorButtonsExample.php
index 0553a4b59f..d234bc2308 100644
--- a/src/applications/uiexample/examples/PhabricatorButtonsExample.php
+++ b/src/applications/uiexample/examples/PhabricatorButtonsExample.php
@@ -28,12 +28,12 @@ final class PhabricatorButtonsExample extends PhabricatorUIExample {
$class .= ' button';
}
- $view[] = phutil_render_tag(
+ $view[] = phutil_tag(
$tag,
array(
'class' => $class,
),
- phutil_escape_html(ucwords($size.' '.$color.' '.$tag)));
+ ucwords($size.' '.$color.' '.$tag));
$view[] = ' '.pht('This diff is very large and affects %d files. Load '.
'each file individually. ', $count).
"".
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $request_uri
diff --git a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
index dfa474be67..1d5be8e265 100644
--- a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
+++ b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
@@ -90,7 +90,7 @@ final class DifferentialChangesetFileTreeSideNavBuilder {
$icon = 'phabricator-filetree-icon-dir';
}
- $icon = phutil_render_tag(
+ $icon = phutil_tag(
'span',
array(
'class' => 'phabricator-filetree-icon '.$icon,
diff --git a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
index 6d622954aa..2c5d5058af 100644
--- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
+++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
@@ -182,7 +182,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
$this->repository->getCallsign());
if ($editor_link) {
$editor_link =
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $editor_link,
diff --git a/src/applications/differential/view/DifferentialInlineCommentEditView.php b/src/applications/differential/view/DifferentialInlineCommentEditView.php
index e60b198a0f..86a2706ce6 100644
--- a/src/applications/differential/view/DifferentialInlineCommentEditView.php
+++ b/src/applications/differential/view/DifferentialInlineCommentEditView.php
@@ -104,7 +104,7 @@ final class DifferentialInlineCommentEditView extends AphrontView {
$buttons = implode('', $buttons);
- $formatting = phutil_render_tag(
+ $formatting = phutil_tag(
'a',
array(
'href' => PhabricatorEnv::getDoclink(
diff --git a/src/applications/differential/view/DifferentialInlineCommentView.php b/src/applications/differential/view/DifferentialInlineCommentView.php
index 015f89e4f5..09ac5a906b 100644
--- a/src/applications/differential/view/DifferentialInlineCommentView.php
+++ b/src/applications/differential/view/DifferentialInlineCommentView.php
@@ -190,7 +190,7 @@ final class DifferentialInlineCommentView extends AphrontView {
if ($this->preview) {
$anchor = null;
} else {
- $anchor = phutil_render_tag(
+ $anchor = phutil_tag(
'a',
array(
'name' => $anchor_name,
diff --git a/src/applications/diffusion/controller/DiffusionCommitTagsController.php b/src/applications/diffusion/controller/DiffusionCommitTagsController.php
index 5dbabff240..7bb6091296 100644
--- a/src/applications/diffusion/controller/DiffusionCommitTagsController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitTagsController.php
@@ -32,7 +32,7 @@ final class DiffusionCommitTagsController extends DiffusionController {
}
if ($has_more_tags) {
- $tag_links[] = phutil_render_tag(
+ $tag_links[] = phutil_tag(
'a',
array(
'href' => $request->generateURI(
diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php
index ea11c4831b..14b734f43d 100644
--- a/src/applications/diffusion/controller/DiffusionController.php
+++ b/src/applications/diffusion/controller/DiffusionController.php
@@ -299,7 +299,7 @@ abstract class DiffusionController extends PhabricatorController {
$last_crumb = array_pop($crumb_list);
if ($raw_commit) {
- $jump_link = phutil_render_tag(
+ $jump_link = phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
diff --git a/src/applications/diffusion/controller/DiffusionHomeController.php b/src/applications/diffusion/controller/DiffusionHomeController.php
index c951b764a8..d06f0d9863 100644
--- a/src/applications/diffusion/controller/DiffusionHomeController.php
+++ b/src/applications/diffusion/controller/DiffusionHomeController.php
@@ -146,7 +146,7 @@ final class DiffusionHomeController extends DiffusionController {
}
$repository_tool_uri = PhabricatorEnv::getProductionURI('/repository/');
- $repository_tool = phutil_render_tag('a',
+ $repository_tool = phutil_tag('a',
array(
'href' => $repository_tool_uri,
),
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php
index 5af0a056ba..714b2819c1 100644
--- a/src/applications/diffusion/controller/DiffusionRepositoryController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php
@@ -60,7 +60,7 @@ final class DiffusionRepositoryController extends DiffusionController {
$history_table->setIsHead(true);
$callsign = $drequest->getRepository()->getCallsign();
- $all = phutil_render_tag(
+ $all = phutil_tag(
'a',
array(
'href' => "/diffusion/{$callsign}/history/",
@@ -182,7 +182,7 @@ final class DiffusionRepositoryController extends DiffusionController {
}
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
@@ -240,7 +240,7 @@ final class DiffusionRepositoryController extends DiffusionController {
}
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
diff --git a/src/applications/diffusion/view/DiffusionBranchTableView.php b/src/applications/diffusion/view/DiffusionBranchTableView.php
index 4ac40d73ca..2d59c04946 100644
--- a/src/applications/diffusion/view/DiffusionBranchTableView.php
+++ b/src/applications/diffusion/view/DiffusionBranchTableView.php
@@ -36,7 +36,7 @@ final class DiffusionBranchTableView extends DiffusionView {
}
$rows[] = array(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
diff --git a/src/applications/diffusion/view/DiffusionBrowseTableView.php b/src/applications/diffusion/view/DiffusionBrowseTableView.php
index fdf1651474..2aed5dbdd3 100644
--- a/src/applications/diffusion/view/DiffusionBrowseTableView.php
+++ b/src/applications/diffusion/view/DiffusionBrowseTableView.php
@@ -204,7 +204,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
$request->getRepository()->getCallsign());
if ($editor_link) {
$show_edit = true;
- $editor_button = phutil_render_tag(
+ $editor_button = phutil_tag(
'a',
array(
'href' => $editor_link,
diff --git a/src/applications/diffusion/view/DiffusionView.php b/src/applications/diffusion/view/DiffusionView.php
index afa52d9d36..df5f139307 100644
--- a/src/applications/diffusion/view/DiffusionView.php
+++ b/src/applications/diffusion/view/DiffusionView.php
@@ -47,7 +47,7 @@ abstract class DiffusionView extends AphrontView {
'path' => $path,
));
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => $href,
diff --git a/src/applications/directory/controller/PhabricatorDirectoryMainController.php b/src/applications/directory/controller/PhabricatorDirectoryMainController.php
index 841f38de61..0302df17ec 100644
--- a/src/applications/directory/controller/PhabricatorDirectoryMainController.php
+++ b/src/applications/directory/controller/PhabricatorDirectoryMainController.php
@@ -109,7 +109,7 @@ final class PhabricatorDirectoryMainController
$panel->setHeader('Unbreak Now!');
$panel->setCaption('Open tasks with "Unbreak Now!" priority.');
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/maniphest/view/all/',
@@ -154,7 +154,7 @@ final class PhabricatorDirectoryMainController
'projects you are a member of.');
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
// TODO: This should filter to just your projects' need-triage
@@ -198,7 +198,7 @@ final class PhabricatorDirectoryMainController
$panel->setCaption('Revisions waiting for you for review or commit.');
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/differential/',
@@ -248,7 +248,7 @@ final class PhabricatorDirectoryMainController
$panel->setHeader('Assigned Tasks');
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/maniphest/',
@@ -294,7 +294,7 @@ final class PhabricatorDirectoryMainController
require_celerity_resource('phabricator-jump-nav');
$doc_href = PhabricatorEnv::getDocLink('article/Jump_Nav_User_Guide.html');
- $doc_link = phutil_render_tag(
+ $doc_link = phutil_tag(
'a',
array(
'href' => $doc_href,
@@ -381,7 +381,7 @@ final class PhabricatorDirectoryMainController
$panel->setCaption('Commits awaiting your audit.');
$panel->appendChild($view);
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/audit/',
@@ -426,7 +426,7 @@ final class PhabricatorDirectoryMainController
$panel->setCaption('Commits which auditors have raised concerns about.');
$panel->appendChild($view);
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/audit/',
diff --git a/src/applications/fact/controller/PhabricatorFactChartController.php b/src/applications/fact/controller/PhabricatorFactChartController.php
index 876866448f..12e52fdaa9 100644
--- a/src/applications/fact/controller/PhabricatorFactChartController.php
+++ b/src/applications/fact/controller/PhabricatorFactChartController.php
@@ -53,7 +53,7 @@ final class PhabricatorFactChartController extends PhabricatorFactController {
$y = array_values($points);
$id = celerity_generate_unique_node_id();
- $chart = phutil_render_tag(
+ $chart = phutil_tag(
'div',
array(
'id' => $id,
diff --git a/src/applications/files/controller/PhabricatorFileUploadController.php b/src/applications/files/controller/PhabricatorFileUploadController.php
index 2c8ce155b9..74c5455e84 100644
--- a/src/applications/files/controller/PhabricatorFileUploadController.php
+++ b/src/applications/files/controller/PhabricatorFileUploadController.php
@@ -104,7 +104,7 @@ final class PhabricatorFileUploadController extends PhabricatorFileController {
$doc_href = PhabricatorEnv::getDocLink(
'article/Configuring_File_Upload_Limits.html');
- $doc_link = phutil_render_tag(
+ $doc_link = phutil_tag(
'a',
array(
'href' => $doc_href,
diff --git a/src/applications/flag/view/PhabricatorFlagListView.php b/src/applications/flag/view/PhabricatorFlagListView.php
index a1f86d5ffe..332f683418 100644
--- a/src/applications/flag/view/PhabricatorFlagListView.php
+++ b/src/applications/flag/view/PhabricatorFlagListView.php
@@ -20,7 +20,7 @@ final class PhabricatorFlagListView extends AphrontView {
$class = PhabricatorFlagColor::getCSSClass($flag->getColor());
$rows[] = array(
- phutil_render_tag(
+ phutil_tag(
'div',
array(
'class' => 'phabricator-flag-icon '.$class,
@@ -36,7 +36,7 @@ final class PhabricatorFlagListView extends AphrontView {
'action' => '/flag/edit/'.$flag->getObjectPHID().'/',
'sigil' => 'workflow',
),
- phutil_render_tag(
+ phutil_tag(
'button',
array(
'class' => 'small grey',
@@ -49,7 +49,7 @@ final class PhabricatorFlagListView extends AphrontView {
'action' => '/flag/delete/'.$flag->getID().'/',
'sigil' => 'workflow',
),
- phutil_render_tag(
+ phutil_tag(
'button',
array(
'class' => 'small grey',
diff --git a/src/applications/herald/controller/HeraldHomeController.php b/src/applications/herald/controller/HeraldHomeController.php
index 16df2de2c2..c058881e31 100644
--- a/src/applications/herald/controller/HeraldHomeController.php
+++ b/src/applications/herald/controller/HeraldHomeController.php
@@ -98,7 +98,7 @@ final class HeraldHomeController extends HeraldController {
if ($can_create) {
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/herald/new/'.$this->contentType.'/'.$this->ruleType.'/',
diff --git a/src/applications/herald/controller/HeraldTranscriptListController.php b/src/applications/herald/controller/HeraldTranscriptListController.php
index 256aa7588c..c4d131fb80 100644
--- a/src/applications/herald/controller/HeraldTranscriptListController.php
+++ b/src/applications/herald/controller/HeraldTranscriptListController.php
@@ -58,7 +58,7 @@ final class HeraldTranscriptListController extends HeraldController {
$handles[$xscript['objectPHID']]->renderLink(),
$xscript['dryRun'] ? 'Yes' : '',
number_format((int)(1000 * $xscript['duration'])).' ms',
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/herald/transcript/'.$xscript['id'].'/',
diff --git a/src/applications/herald/view/HeraldRuleListView.php b/src/applications/herald/view/HeraldRuleListView.php
index 2bfe609bdf..18aa093b61 100644
--- a/src/applications/herald/view/HeraldRuleListView.php
+++ b/src/applications/herald/view/HeraldRuleListView.php
@@ -51,7 +51,7 @@ final class HeraldRuleListView extends AphrontView {
),
$rule->getName());
- $edit_log = phutil_render_tag(
+ $edit_log = phutil_tag(
'a',
array(
'href' => '/herald/history/'.$rule->getID().'/',
diff --git a/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php b/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php
index 74f4d75e66..c675d4b30b 100644
--- a/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php
+++ b/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php
@@ -33,7 +33,7 @@ final class PhabricatorMailingListsListController
$rows[] = array(
phutil_escape_html($list->getName()),
phutil_escape_html($list->getEmail()),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'class' => 'button grey small',
diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php
index cee45c4c20..cd77f4da3e 100644
--- a/src/applications/maniphest/controller/ManiphestReportController.php
+++ b/src/applications/maniphest/controller/ManiphestReportController.php
@@ -271,7 +271,7 @@ final class ManiphestReportController extends ManiphestController {
$filter = $this->renderReportFilters($tokens, $has_window = false);
$id = celerity_generate_unique_node_id();
- $chart = phutil_render_tag(
+ $chart = phutil_tag(
'div',
array(
'id' => $id,
@@ -409,12 +409,12 @@ final class ManiphestReportController extends ManiphestController {
unset($result_closed['']);
$base_link = '/maniphest/?users=';
- $leftover_name = phutil_render_tag(
+ $leftover_name = phutil_tag(
'a',
array(
'href' => $base_link.ManiphestTaskOwner::OWNER_UP_FOR_GRABS,
),
- '(Up For Grabs)');
+ phutil_render_html('em', array(), '(Up For Grabs)'));
$col_header = 'User';
$header = 'Open Tasks by User and Priority ('.$date.')';
break;
@@ -446,12 +446,12 @@ final class ManiphestReportController extends ManiphestController {
}
$base_link = '/maniphest/view/all/?projects=';
- $leftover_name = phutil_render_tag(
+ $leftover_name = phutil_tag(
'a',
array(
'href' => $base_link.ManiphestTaskOwner::PROJECT_NO_PROJECT,
),
- '(No Project)');
+ phutil_render_html('em', array(), '(No Project)'));
$col_header = 'Project';
$header = 'Open Tasks by Project and Priority ('.$date.')';
break;
diff --git a/src/applications/maniphest/controller/ManiphestSavedQueryListController.php b/src/applications/maniphest/controller/ManiphestSavedQueryListController.php
index 9957aa0991..ba8fcb1e85 100644
--- a/src/applications/maniphest/controller/ManiphestSavedQueryListController.php
+++ b/src/applications/maniphest/controller/ManiphestSavedQueryListController.php
@@ -54,7 +54,7 @@ final class ManiphestSavedQueryListController extends ManiphestController {
'href' => '/maniphest/view/custom/?key='.$query->getQueryKey(),
),
$query->getName()),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/maniphest/custom/edit/'.$query->getID().'/',
@@ -105,7 +105,7 @@ final class ManiphestSavedQueryListController extends ManiphestController {
$panel = new AphrontPanelView();
$panel->setHeader('Saved Custom Queries');
$panel->addButton(
- phutil_render_tag(
+ phutil_tag(
'button',
array(),
'Save Default Query'));
diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
index 13482b8f35..bbc7a4d5ac 100644
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -89,7 +89,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
if ($parent_task) {
$context_bar = new AphrontContextBarView();
$context_bar->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/maniphest/task/create/?parent='.$parent_task->getID(),
@@ -104,7 +104,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
$context_bar = new AphrontContextBarView();
$context_bar->addButton('');
$context_bar->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/maniphest/task/create/?template='.$task->getID(),
@@ -112,7 +112,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
),
'Similar Task'));
$context_bar->addButton(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/maniphest/task/create/',
diff --git a/src/applications/maniphest/controller/ManiphestTaskListController.php b/src/applications/maniphest/controller/ManiphestTaskListController.php
index 3b8db2ed52..1508690729 100644
--- a/src/applications/maniphest/controller/ManiphestTaskListController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskListController.php
@@ -661,14 +661,14 @@ final class ManiphestTaskListController extends ManiphestController {
),
'Clear Selection');
- $submit = phutil_render_tag(
+ $submit = phutil_tag(
'button',
array(
'id' => 'batch-select-submit',
'disabled' => 'disabled',
'class' => 'disabled',
),
- 'Batch Edit Selected Tasks »');
+ "Batch Edit Selected Tasks \xC2\xBB");
$export = javelin_render_tag(
'a',
diff --git a/src/applications/meta/view/PhabricatorApplicationLaunchView.php b/src/applications/meta/view/PhabricatorApplicationLaunchView.php
index d3658cdf29..e3997c0c0b 100644
--- a/src/applications/meta/view/PhabricatorApplicationLaunchView.php
+++ b/src/applications/meta/view/PhabricatorApplicationLaunchView.php
@@ -84,7 +84,7 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
$classes[] = 'app-'.$icon.'-light-large';
}
- $icon = phutil_render_tag(
+ $icon = phutil_tag(
'span',
array(
'class' => implode(' ', $classes),
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAListController.php b/src/applications/metamta/controller/PhabricatorMetaMTAListController.php
index bcd6897ea0..5e419987c4 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTAListController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTAListController.php
@@ -68,7 +68,7 @@ final class PhabricatorMetaMTAListController
phabricator_format_relative_time_detailed(
time() - $mail->getDateModified()),
phutil_escape_html($mail->getSubject()),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'class' => 'button small grey',
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTASendController.php b/src/applications/metamta/controller/PhabricatorMetaMTASendController.php
index ae3b1afc68..bf1917e430 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTASendController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTASendController.php
@@ -48,7 +48,7 @@ final class PhabricatorMetaMTASendController
$doclink_href = PhabricatorEnv::getDoclink(
'article/Configuring_Outbound_Email.html');
- $doclink = phutil_render_tag(
+ $doclink = phutil_tag(
'a',
array(
'href' => $doclink_href,
@@ -77,7 +77,7 @@ final class PhabricatorMetaMTASendController
$phdlink_href = PhabricatorEnv::getDoclink(
'article/Managing_Daemons_with_phd.html');
- $phdlink = phutil_render_tag(
+ $phdlink = phutil_tag(
'a',
array(
'href' => $phdlink_href,
diff --git a/src/applications/notification/controller/PhabricatorNotificationPanelController.php b/src/applications/notification/controller/PhabricatorNotificationPanelController.php
index 969b139b52..b25365c607 100644
--- a/src/applications/notification/controller/PhabricatorNotificationPanelController.php
+++ b/src/applications/notification/controller/PhabricatorNotificationPanelController.php
@@ -32,7 +32,7 @@ final class PhabricatorNotificationPanelController
' '.$home_link.' '.$text_1.' '.$command.' '.$text_2.' Copy and paste this token into '.
'the prompt given to you by "arc install-certificate": '.
- ''.phutil_escape_html($token->getToken()).''.
+ '%s'.
' arc will then complete the '.
- 'install process for you. NOTE: This table reflects tasks currently in ".
- "the project. If a task was opened in the past but added to ".
- "the project recently, it is counted on the day it was ".
- "opened, not the day it was categorized. If a task was part ".
- "of this project in the past but no longer is, it is not ".
- "counted at all. NOTE: This table reflects tasks currently in ".
+ "the project. If a task was opened in the past but added to ".
+ "the project recently, it is counted on the day it was ".
+ "opened, not the day it was categorized. If a task was part ".
+ "of this project in the past but no longer is, it is not ".
+ "counted at all. You were stopped here because debug.stop-on-redirect '.
'is set in your configuration. '.$link.' %s '.
- pht('Another verification email was sent to %s.',
- phutil_escape_html($email_address)).' '.phutil_escape_html($msg).' '.phutil_escape_html($msg).' This task may have recently been garbage collected. This diff was created without running lint. Make sure you are ".
- "OK with that before you accept this diff. Postponed linters didn't finish yet. Make sure you are OK with ".
- "that before you accept this diff. This diff has Lint Problems. Make sure you are OK with them ".
- "before you accept this diff. This diff has postponed unit tests. The results should be ".
+ "This diff has postponed unit tests. The results should be ".
"coming in soon. You should probably wait for them before accepting ".
- "this diff. Unit tests were skipped when this diff was created. Make sure ".
- "you are OK with that before you accept this diff. This diff has Unit Test Problems. Make sure you are OK with ".
- "them before you accept this diff. This commit is very large. Load each file individually. This external ({$desc}) does not appear in any tracked ".
+ ->appendChild(phutil_tag(
+ 'p',
+ array(),
+ "This external ({$desc}) does not appear in any tracked ".
"repository. It may exist in an untracked repository that ".
- "Diffusion does not know about. '.$body.' '.pht(
- 'There are no facts that can be plotted yet.').' Details of this transcript have been garbage collected. '.pht('This installation of Phabricator is currently set to use '.
- 'PhabricatorMailImplementationTestAdapter to deliver '.
- 'outbound email. This completely disables outbound email! All '.
- 'outbound email will be thrown in a deep, dark hole until you '.
- 'configure a real adapter.').' '.$home_link.' %s '.$settings_link.' %s The verification code is incorrect, the email address has '.
- 'been removed, or the email address is owned by another user. Make '.
- 'sure you followed the link in the email correctly. This email address has already been verified. This email address has already been verified. This email address has now been verified. Thanks! This email address has now been verified. Thanks! Your changes were saved. As you stare into the gaping maw of the abyss, something holds '.
'you back. You can not delete your own account. You can not delete your own account. Showing a saved draft of your edits, you can '.$discard.'. Showing a saved draft of your edits, you can %s. The repository daemon is not running on this machine. ".
- "{$common} The repository daemon is not running on this machine. %s Unable to determine if the repository daemon is running on this ".
- "machine. {$common} Exception: ".
- phutil_escape_html($ex->getMessage()).
- " Exception: %s Your changes have been saved. Your old certificate has been destroyed and you have been issued '.
+ $notice->appendChild(phutil_tag(
+ 'p',
+ array(),
+ 'Your old certificate has been destroyed and you have been issued '.
'a new certificate. Sessions established under the old certificate '.
- 'are no longer valid. Your changes have been saved. Your password has been updated. Your changes have been saved. '.$instructions.' %s '.$instructions.' %s Select a path on local disk '.
- 'which the daemons should '.$clone_command.' the repository '.
- 'into. This must be readable and writable by the daemons, and '.
- 'readable by the webserver. The daemons will '.$fetch_command.
- ' and keep this repository up to date.".pht('This diff belongs to revision %s', $link)."
");
} else {
@@ -52,12 +52,12 @@ final class DifferentialDiffViewController extends DifferentialController {
if ($revisions) {
$select[] = '';
}
diff --git a/src/applications/differential/field/specification/DifferentialTitleFieldSpecification.php b/src/applications/differential/field/specification/DifferentialTitleFieldSpecification.php
index 6a1c6ce20c..07095e0800 100644
--- a/src/applications/differential/field/specification/DifferentialTitleFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialTitleFieldSpecification.php
@@ -87,12 +87,12 @@ final class DifferentialTitleFieldSpecification
}
public function renderValueForRevisionList(DifferentialRevision $revision) {
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => '/D'.$revision->getID(),
),
- phutil_escape_html($revision->getTitle()));
+ $revision->getTitle());
}
}
diff --git a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
index e13117d2b5..dfa474be67 100644
--- a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
+++ b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
@@ -97,12 +97,12 @@ final class DifferentialChangesetFileTreeSideNavBuilder {
),
'');
- $name_element = phutil_render_tag(
+ $name_element = phutil_tag(
'span',
array(
'class' => 'phabricator-filetree-name',
),
- phutil_escape_html($name));
+ $name);
$filetree[] = javelin_render_tag(
$href ? 'a' : 'span',
diff --git a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
index ff00f973e9..8e7e9f926c 100644
--- a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
+++ b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
@@ -145,10 +145,10 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
}
$last_base = $base;
- $id_link = phutil_render_tag(
+ $id_link = phutil_tag(
'a',
array('href' => '/differential/diff/'.$id.'/'),
- phutil_escape_html($id));
+ $id);
$rows[] =
''.
' ';
}
- $table = phutil_render_tag(
+ $table = phutil_tag(
'table',
- array(
-
- ),
- implode("\n", $table));
+ array(),
+ new PhutilSafeHTML(implode("\n", $table)));
ob_start();
phpinfo();
@@ -269,14 +271,14 @@ final class PhabricatorSetupIssueView extends AphrontView {
}
if (!$ini_loc) {
- $info = phutil_render_tag(
+ $info = phutil_tag(
'p',
array(),
pht(
"To update these %d value(s), edit your PHP configuration file.",
count($configs)));
} else {
- $info = phutil_render_tag(
+ $info = phutil_tag(
'p',
array(),
pht(
@@ -290,7 +292,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
}
if ($more_loc) {
- $info .= phutil_render_tag(
+ $info .= phutil_tag(
'p',
array(),
pht(
@@ -302,32 +304,27 @@ final class PhabricatorSetupIssueView extends AphrontView {
implode("\n", $more_loc));
}
- $info .= phutil_render_tag(
+ $info .= phutil_tag(
'p',
array(),
- pht(
- "You can find more information about PHP configuration values in the ".
- "%s.",
- phutil_tag(
- 'a',
- array(
- 'href' => 'http://php.net/manual/ini.list.php',
- ),
- pht('PHP Documentation'))));
+ phutil_safe_html(pht(
+ 'You can find more information about PHP configuration values in the '.
+ 'PHP Documentation.',
+ 'http://php.net/manual/ini.list.php')));
- $info .= phutil_render_tag(
+ $info .= phutil_tag(
'p',
array(),
- pht(
+ phutil_safe_html(pht(
"After editing the PHP configuration, restart your ".
- "webserver for the changes to take effect."));
+ "webserver for the changes to take effect.")));
- return phutil_render_tag(
+ return phutil_tag(
'div',
array(
'class' => 'setup-issue-config',
),
- $table_info.$table.$info);
+ array($table_info, $table, $info));
}
}
diff --git a/src/applications/daemon/view/PhabricatorDaemonLogListView.php b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
index 35f234733a..c60b584209 100644
--- a/src/applications/daemon/view/PhabricatorDaemonLogListView.php
+++ b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
@@ -66,7 +66,7 @@ final class PhabricatorDaemonLogListView extends AphrontView {
$symbol = '?';
}
- $running = phutil_render_tag(
+ $running = phutil_tag(
'span',
array(
'style' => $style,
diff --git a/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php b/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
index b2a9a4c943..2c0164a255 100644
--- a/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
@@ -87,7 +87,7 @@ final class DifferentialLintFieldSpecification
if ($diff->getID() != $this->getDiff()->getID()) {
$href = '/D'.$diff->getRevisionID().'?id='.$diff->getID().$href;
}
- $line_link = phutil_render_tag(
+ $line_link = phutil_tag(
'a',
array(
'href' => $href,
diff --git a/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php b/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
index 8900aef7f8..b4e89b3fa9 100644
--- a/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
@@ -93,9 +93,9 @@ final class DifferentialUnitFieldSpecification
$hidden[$result]++;
}
- $value = phutil_escape_html(idx($test, 'name'));
+ $value = idx($test, 'name');
if (!empty($test['link'])) {
- $value = phutil_render_tag(
+ $value = phutil_tag(
'a',
array(
'href' => $test['link'],
diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php
index fc969acd94..acea5b060d 100644
--- a/src/applications/differential/view/DifferentialChangesetListView.php
+++ b/src/applications/differential/view/DifferentialChangesetListView.php
@@ -158,12 +158,12 @@ final class DifferentialChangesetListView extends AphrontView {
'Load');
}
$detail->appendChild(
- phutil_render_tag(
+ phutil_tag(
'div',
array(
'id' => $uniq_id,
),
- ''.phutil_escape_html($name).' '.
@@ -179,7 +179,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
$select = '';
diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
index edab2227ed..c0835332f4 100644
--- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -178,12 +178,12 @@ final class DiffusionBrowseFileController extends DiffusionController {
case 'plain':
$style =
"margin: 1em 2em; width: 90%; height: 80em; font-family: monospace";
- $corpus = phutil_render_tag(
+ $corpus = phutil_tag(
'textarea',
array(
'style' => $style,
),
- phutil_escape_html($file_query->getRawData()));
+ $file_query->getRawData());
break;
@@ -205,12 +205,12 @@ final class DiffusionBrowseFileController extends DiffusionController {
sprintf("%-10s %-20s %s", substr($rev, 0, 7), $author, $line);
}
- $corpus = phutil_render_tag(
+ $corpus = phutil_tag(
'textarea',
array(
'style' => $style,
),
- phutil_escape_html(implode("\n", $rows)));
+ implode("\n", $rows));
break;
@@ -493,11 +493,11 @@ final class DiffusionBrowseFileController extends DiffusionController {
if (isset($blame['handle'])) {
$author_link = $blame['handle']->renderLink();
} else {
- $author_link = phutil_render_tag(
+ $author_link = phutil_tag(
'span',
array(
),
- phutil_escape_html($blame['author']));
+ $blame['author']);
}
$display_line['author'] = $author_link;
@@ -699,12 +699,12 @@ final class DiffusionBrowseFileController extends DiffusionController {
idx($line, 'author'));
}
- $line_link = phutil_render_tag(
+ $line_link = phutil_tag(
'a',
array(
'href' => $line_href,
),
- phutil_escape_html($line['line']));
+ $line['line']);
$blame[] = javelin_render_tag(
'th',
diff --git a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
index c456d5e9af..4b306f5b10 100644
--- a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
@@ -14,7 +14,7 @@ final class DiffusionCommitBranchesController extends DiffusionController {
$branch_links = array();
foreach ($branches as $branch => $commit) {
- $branch_links[] = phutil_render_tag(
+ $branch_links[] = phutil_tag(
'a',
array(
'href' => $request->generateURI(
@@ -23,7 +23,7 @@ final class DiffusionCommitBranchesController extends DiffusionController {
'branch' => $branch,
)),
),
- phutil_escape_html($branch));
+ $branch);
}
return id(new AphrontAjaxResponse())
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
index 72ba662840..8afcc4b0e7 100644
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -178,13 +178,13 @@ final class DiffusionCommitController extends DiffusionController {
$change_panel->setID('toc');
if ($count > self::CHANGES_LIMIT) {
- $show_all_button = phutil_render_tag(
+ $show_all_button = phutil_tag(
'a',
array(
'class' => 'button green',
'href' => '?show_all=true',
),
- phutil_escape_html('Show All Changes'));
+ 'Show All Changes');
$warning_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->setTitle('Very Large Commit')
@@ -399,10 +399,10 @@ final class DiffusionCommitController extends DiffusionController {
if ($commit->getAuditStatus()) {
$status = PhabricatorAuditCommitStatusConstants::getStatusName(
$commit->getAuditStatus());
- $props['Status'] = phutil_render_tag(
+ $props['Status'] = phutil_tag(
'strong',
array(),
- phutil_escape_html($status));
+ $status);
}
$props['Committed'] = phabricator_datetime($commit->getEpoch(), $user);
@@ -892,7 +892,7 @@ final class DiffusionCommitController extends DiffusionController {
$ref_links = array();
foreach ($refs as $ref) {
- $ref_links[] = phutil_render_tag(
+ $ref_links[] = phutil_tag(
'a',
array(
'href' => $request->generateURI(
@@ -901,7 +901,7 @@ final class DiffusionCommitController extends DiffusionController {
'branch' => $ref,
)),
),
- phutil_escape_html($ref));
+ $ref);
}
$ref_links = implode(', ', $ref_links);
return $ref_links;
diff --git a/src/applications/diffusion/controller/DiffusionCommitTagsController.php b/src/applications/diffusion/controller/DiffusionCommitTagsController.php
index fea9d58716..5dbabff240 100644
--- a/src/applications/diffusion/controller/DiffusionCommitTagsController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitTagsController.php
@@ -19,7 +19,7 @@ final class DiffusionCommitTagsController extends DiffusionController {
$tag_links = array();
foreach ($tags as $tag) {
- $tag_links[] = phutil_render_tag(
+ $tag_links[] = phutil_tag(
'a',
array(
'href' => $request->generateURI(
@@ -28,7 +28,7 @@ final class DiffusionCommitTagsController extends DiffusionController {
'commit' => $tag->getName(),
)),
),
- phutil_escape_html($tag->getName()));
+ $tag->getName());
}
if ($has_more_tags) {
diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php
index 4178c6bd2a..ea11c4831b 100644
--- a/src/applications/diffusion/controller/DiffusionController.php
+++ b/src/applications/diffusion/controller/DiffusionController.php
@@ -278,7 +278,7 @@ abstract class DiffusionController extends PhabricatorController {
$thus_far = '';
foreach ($path_parts as $path_part) {
$thus_far .= $path_part.'/';
- $path_sections[] = phutil_render_tag(
+ $path_sections[] = phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
@@ -286,7 +286,7 @@ abstract class DiffusionController extends PhabricatorController {
'path' => $thus_far,
) + $uri_params),
),
- phutil_escape_html($path_part));
+ $path_part);
}
$path_sections[] = phutil_escape_html($last);
diff --git a/src/applications/diffusion/controller/DiffusionExternalController.php b/src/applications/diffusion/controller/DiffusionExternalController.php
index 1f3fc6c6b2..738cee81fd 100644
--- a/src/applications/diffusion/controller/DiffusionExternalController.php
+++ b/src/applications/diffusion/controller/DiffusionExternalController.php
@@ -95,13 +95,12 @@ final class DiffusionExternalController extends DiffusionController {
'commit' => $commit->getCommitIdentifier(),
));
$rows[] = array(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $href,
),
- phutil_escape_html(
- 'r'.$repo->getCallsign().$commit->getCommitIdentifier())),
+ 'r'.$repo->getCallsign().$commit->getCommitIdentifier()),
phutil_escape_html($commit->loadCommitData()->getSummary()),
);
}
diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionHistoryController.php
index 4b9193616d..fe541054e7 100644
--- a/src/applications/diffusion/controller/DiffusionHistoryController.php
+++ b/src/applications/diffusion/controller/DiffusionHistoryController.php
@@ -47,13 +47,13 @@ final class DiffusionHistoryController extends DiffusionController {
$copies_new = true;
}
- $button = phutil_render_tag(
+ $button = phutil_tag(
'a',
array(
'class' => 'button small grey',
'href' => $request->getRequestURI()->alter('copies', $copies_new),
),
- phutil_escape_html($button_title));
+ $button_title);
$history_table = new DiffusionHistoryTableView();
$history_table->setUser($request->getUser());
diff --git a/src/applications/diffusion/controller/DiffusionHomeController.php b/src/applications/diffusion/controller/DiffusionHomeController.php
index d59504f69a..c951b764a8 100644
--- a/src/applications/diffusion/controller/DiffusionHomeController.php
+++ b/src/applications/diffusion/controller/DiffusionHomeController.php
@@ -13,12 +13,12 @@ final class DiffusionHomeController extends DiffusionController {
$rows = array();
foreach ($shortcuts as $shortcut) {
$rows[] = array(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $shortcut->getHref(),
),
- phutil_escape_html($shortcut->getName())),
+ $shortcut->getName()),
phutil_escape_html($shortcut->getDescription()),
);
}
@@ -124,12 +124,12 @@ final class DiffusionHomeController extends DiffusionController {
}
$rows[] = array(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/diffusion/'.$repository->getCallsign().'/',
),
- phutil_escape_html($repository->getName())),
+ $repository->getName()),
phutil_escape_html($repository->getDetail('description')),
PhabricatorRepositoryType::getNameForRepositoryType(
$repository->getVersionControlSystem()),
diff --git a/src/applications/diffusion/controller/DiffusionSymbolController.php b/src/applications/diffusion/controller/DiffusionSymbolController.php
index ab118c3948..17fcea83ae 100644
--- a/src/applications/diffusion/controller/DiffusionSymbolController.php
+++ b/src/applications/diffusion/controller/DiffusionSymbolController.php
@@ -94,12 +94,12 @@ final class DiffusionSymbolController extends DiffusionController {
return id(new AphrontRedirectResponse())->setURI($href);
}
- $location = phutil_render_tag(
+ $location = phutil_tag(
'a',
array(
'href' => $href,
),
- phutil_escape_html($file.':'.$line));
+ $file.':'.$line);
} else if ($file) {
$location = phutil_escape_html($file.':'.$line);
} else {
diff --git a/src/applications/diffusion/view/DiffusionBranchTableView.php b/src/applications/diffusion/view/DiffusionBranchTableView.php
index ee95580932..4ac40d73ca 100644
--- a/src/applications/diffusion/view/DiffusionBranchTableView.php
+++ b/src/applications/diffusion/view/DiffusionBranchTableView.php
@@ -47,7 +47,7 @@ final class DiffusionBranchTableView extends DiffusionView {
),
'History'
),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
@@ -56,7 +56,7 @@ final class DiffusionBranchTableView extends DiffusionView {
'branch' => $branch->getName(),
)),
),
- phutil_escape_html($branch->getName())),
+ $branch->getName()),
self::linkCommit(
$drequest->getRepository(),
$branch->getHeadCommitIdentifier()),
diff --git a/src/applications/diffusion/view/DiffusionBrowseTableView.php b/src/applications/diffusion/view/DiffusionBrowseTableView.php
index 004faf0a21..fdf1651474 100644
--- a/src/applications/diffusion/view/DiffusionBrowseTableView.php
+++ b/src/applications/diffusion/view/DiffusionBrowseTableView.php
@@ -278,12 +278,12 @@ final class DiffusionBrowseTableView extends DiffusionView {
require_celerity_resource('diffusion-icons-css');
- return phutil_render_tag(
+ return phutil_tag(
'span',
array(
'class' => 'diffusion-path-icon diffusion-path-icon-'.$type,
),
- phutil_escape_html($text));
+ $text);
}
}
diff --git a/src/applications/diffusion/view/DiffusionTagListView.php b/src/applications/diffusion/view/DiffusionTagListView.php
index dee0ec3d2a..b2291dcfe9 100644
--- a/src/applications/diffusion/view/DiffusionTagListView.php
+++ b/src/applications/diffusion/view/DiffusionTagListView.php
@@ -34,7 +34,7 @@ final class DiffusionTagListView extends DiffusionView {
foreach ($this->tags as $tag) {
$commit = idx($this->commits, $tag->getCommitIdentifier());
- $tag_link = phutil_render_tag(
+ $tag_link = phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
@@ -43,9 +43,9 @@ final class DiffusionTagListView extends DiffusionView {
'commit' => $tag->getName(),
)),
),
- phutil_escape_html($tag->getName()));
+ $tag->getName());
- $commit_link = phutil_render_tag(
+ $commit_link = phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
@@ -54,9 +54,8 @@ final class DiffusionTagListView extends DiffusionView {
'commit' => $tag->getCommitIdentifier(),
)),
),
- phutil_escape_html(
$repository->formatCommitName(
- $tag->getCommitIdentifier())));
+ $tag->getCommitIdentifier()));
$author = null;
if ($commit && $commit->getAuthorPHID()) {
diff --git a/src/applications/diviner/controller/DivinerListController.php b/src/applications/diviner/controller/DivinerListController.php
index 7ac7aa453a..2125532b98 100644
--- a/src/applications/diviner/controller/DivinerListController.php
+++ b/src/applications/diviner/controller/DivinerListController.php
@@ -33,13 +33,13 @@ final class DivinerListController extends PhabricatorController {
$name = $link['name'];
$flavor = $link['flavor'];
- $link = phutil_render_tag(
+ $link = phutil_tag(
'a',
array(
'href' => $href,
'target' => '_blank',
),
- phutil_escape_html($name));
+ $name);
$out[] =
''.
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/T'.$task->getID(),
),
- phutil_escape_html($task->getTitle())).
+ $task->getTitle()).
' '.
''.
$projects_view->render().
diff --git a/src/applications/meta/view/PhabricatorApplicationLaunchView.php b/src/applications/meta/view/PhabricatorApplicationLaunchView.php
index c5c45ae1ef..d3658cdf29 100644
--- a/src/applications/meta/view/PhabricatorApplicationLaunchView.php
+++ b/src/applications/meta/view/PhabricatorApplicationLaunchView.php
@@ -31,12 +31,12 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
$icon = null;
$create_button = null;
if ($application) {
- $content[] = phutil_render_tag(
+ $content[] = phutil_tag(
'span',
array(
'class' => 'phabricator-application-launch-name',
),
- phutil_escape_html($application->getName()));
+ $application->getName());
if ($application->isBeta()) {
$content[] = phutil_render_tag(
@@ -48,12 +48,12 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
}
if ($this->fullWidth) {
- $content[] = phutil_render_tag(
+ $content[] = phutil_tag(
'span',
array(
'class' => 'phabricator-application-launch-description',
),
- phutil_escape_html($application->getShortDescription()));
+ $application->getShortDescription());
}
$count = 0;
@@ -64,12 +64,12 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
}
if ($count) {
- $content[] = phutil_render_tag(
+ $content[] = phutil_tag(
'span',
array(
'class' => 'phabricator-application-launch-attention',
),
- phutil_escape_html($count));
+ $count);
}
$classes = array();
diff --git a/src/applications/meta/view/PhabricatorApplicationStatusView.php b/src/applications/meta/view/PhabricatorApplicationStatusView.php
index 81718177eb..cc2339b9c3 100644
--- a/src/applications/meta/view/PhabricatorApplicationStatusView.php
+++ b/src/applications/meta/view/PhabricatorApplicationStatusView.php
@@ -37,12 +37,12 @@ final class PhabricatorApplicationStatusView extends AphrontView {
'phabricator-application-status-type-'.$this->type,
);
- return phutil_render_tag(
+ return phutil_tag(
'span',
array(
'class' => implode(' ', $classes),
),
- phutil_escape_html($this->text));
+ $this->text);
}
}
diff --git a/src/applications/metamta/PhabricatorMetaMTAWorker.php b/src/applications/metamta/PhabricatorMetaMTAWorker.php
index 4e7bff2331..f3075033b3 100644
--- a/src/applications/metamta/PhabricatorMetaMTAWorker.php
+++ b/src/applications/metamta/PhabricatorMetaMTAWorker.php
@@ -42,10 +42,10 @@ final class PhabricatorMetaMTAWorker
}
public function renderForDisplay() {
- return phutil_render_tag(
+ return phutil_tag(
'a',
array('href' => '/mail/view/'.$this->getTaskData().'/'),
- phutil_escape_html($this->getTaskData()));
+ $this->getTaskData());
}
}
diff --git a/src/applications/oauthserver/controller/client/PhabricatorOAuthClientListController.php b/src/applications/oauthserver/controller/client/PhabricatorOAuthClientListController.php
index b10d5c3c9a..072167576a 100644
--- a/src/applications/oauthserver/controller/client/PhabricatorOAuthClientListController.php
+++ b/src/applications/oauthserver/controller/client/PhabricatorOAuthClientListController.php
@@ -31,21 +31,21 @@ extends PhabricatorOAuthClientBaseController {
$highlight = $this->getHighlightPHIDs();
foreach ($clients as $client) {
$row = array(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $client->getViewURI(),
),
- phutil_escape_html($client->getName())
+ $client->getName()
),
$client->getPHID(),
$client->getSecret(),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $client->getRedirectURI(),
),
- phutil_escape_html($client->getRedirectURI())
+ $client->getRedirectURI()
),
phutil_render_tag(
'a',
diff --git a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationEditController.php b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationEditController.php
index 06d2969e67..ad834f75cf 100644
--- a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationEditController.php
+++ b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationEditController.php
@@ -61,12 +61,12 @@ extends PhabricatorOAuthClientAuthorizationBaseController {
id(new AphrontFormMarkupControl())
->setLabel('Client')
->setValue(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $client->getViewURI(),
),
- phutil_escape_html($client->getName())))
+ $client->getName()))
)
->appendChild(
id(new AphrontFormStaticControl())
diff --git a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php
index 9468457353..c74b040296 100644
--- a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php
+++ b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php
@@ -50,12 +50,12 @@ extends PhabricatorOAuthClientAuthorizationBaseController {
'article/Using_the_Phabricator_OAuth_Server.html#scopes'
);
$row = array(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $client->getViewURI(),
),
- phutil_escape_html($client->getName())
+ $client->getName()
),
phutil_render_tag(
'a',
diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php
index f8137b977d..485a3014ab 100644
--- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php
+++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php
@@ -94,12 +94,12 @@ final class PhabricatorOwnersDetailController
));
$repo_name = ''.phutil_escape_html($repo->getName()).
'';
- $path_link = phutil_render_tag(
+ $path_link = phutil_tag(
'a',
array(
'href' => (string) $href,
),
- phutil_escape_html($path->getPath()));
+ $path->getPath());
$path_links[] =
($path->getExcluded() ? '–' : '+').' '.
$repo_name.' '.$path_link;
diff --git a/src/applications/owners/controller/PhabricatorOwnersListController.php b/src/applications/owners/controller/PhabricatorOwnersListController.php
index b734b38d56..c23ed1eb5f 100644
--- a/src/applications/owners/controller/PhabricatorOwnersListController.php
+++ b/src/applications/owners/controller/PhabricatorOwnersListController.php
@@ -254,12 +254,12 @@ final class PhabricatorOwnersListController
$pkg_paths[$key] =
($path->getExcluded() ? '–' : '+').' '.
''.phutil_escape_html($repo->getName()).' '.
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => (string) $href,
),
- phutil_escape_html($path->getPath()));
+ $path->getPath());
} else {
$pkg_paths[$key] = phutil_escape_html($path->getPath());
}
@@ -267,20 +267,20 @@ final class PhabricatorOwnersListController
$pkg_paths = implode('
', $pkg_paths);
$rows[] = array(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/owners/package/'.$package->getID().'/',
),
- phutil_escape_html($package->getName())),
+ $package->getName()),
$pkg_owners,
$pkg_paths,
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/audit/view/packagecommits/?phid='.$package->getPHID(),
),
- phutil_escape_html('Related Commits'))
+ 'Related Commits')
);
}
diff --git a/src/applications/people/controller/PhabricatorPeopleListController.php b/src/applications/people/controller/PhabricatorPeopleListController.php
index 8ec8bf07d3..ce6f60e45a 100644
--- a/src/applications/people/controller/PhabricatorPeopleListController.php
+++ b/src/applications/people/controller/PhabricatorPeopleListController.php
@@ -49,12 +49,12 @@ final class PhabricatorPeopleListController
$rows[] = array(
phabricator_date($user->getDateCreated(), $viewer),
phabricator_time($user->getDateCreated(), $viewer),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/p/'.$user->getUsername().'/',
),
- phutil_escape_html($user->getUserName())),
+ $user->getUserName()),
phutil_escape_html($user->getRealName()),
$status,
$email,
diff --git a/src/applications/people/controller/PhabricatorPeopleLogsController.php b/src/applications/people/controller/PhabricatorPeopleLogsController.php
index 1621bd58fe..9b10f34396 100644
--- a/src/applications/people/controller/PhabricatorPeopleLogsController.php
+++ b/src/applications/people/controller/PhabricatorPeopleLogsController.php
@@ -163,22 +163,22 @@ final class PhabricatorPeopleLogsController
phutil_escape_html($handles[$log->getUserPHID()]->getName()),
json_encode($log->getOldValue(), true),
json_encode($log->getNewValue(), true),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $request
->getRequestURI()
->alter('ip', $log->getRemoteAddr()),
),
- phutil_escape_html($log->getRemoteAddr())),
- phutil_render_tag(
+ $log->getRemoteAddr()),
+ phutil_tag(
'a',
array(
'href' => $request
->getRequestURI()
->alter('session', $log->getSession()),
),
- phutil_escape_html($log->getSession())),
+ $log->getSession()),
);
}
diff --git a/src/applications/phame/view/PhamePostView.php b/src/applications/phame/view/PhamePostView.php
index 6e63fe7f17..60ab1dbc5d 100644
--- a/src/applications/phame/view/PhamePostView.php
+++ b/src/applications/phame/view/PhamePostView.php
@@ -64,27 +64,26 @@ final class PhamePostView extends AphrontView {
array(
'class' => 'phame-post-title',
),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $href,
),
- phutil_escape_html($this->getPost()->getTitle())));
+ $this->getPost()->getTitle()));
}
public function renderDatePublished() {
- return phutil_render_tag(
+ return phutil_tag(
'div',
array(
'class' => 'phame-post-date',
),
- phutil_escape_html(
pht(
'Published on %s by %s',
phabricator_datetime(
$this->getPost()->getDatePublished(),
$this->getUser()),
- $this->getAuthor()->getName())));
+ $this->getAuthor()->getName()));
}
public function renderBody() {
diff --git a/src/applications/phid/PhabricatorObjectHandle.php b/src/applications/phid/PhabricatorObjectHandle.php
index 7fd232c385..c16059d505 100644
--- a/src/applications/phid/PhabricatorObjectHandle.php
+++ b/src/applications/phid/PhabricatorObjectHandle.php
@@ -190,14 +190,14 @@ final class PhabricatorObjectHandle {
$title = 'disabled'; // Overwrite status.
}
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => $this->getURI(),
'class' => $class,
'title' => $title,
),
- phutil_escape_html($name));
+ $name);
}
public function getLinkName() {
diff --git a/src/applications/phid/controller/PhabricatorPHIDLookupController.php b/src/applications/phid/controller/PhabricatorPHIDLookupController.php
index 7fa5e64e12..c6228df5c2 100644
--- a/src/applications/phid/controller/PhabricatorPHIDLookupController.php
+++ b/src/applications/phid/controller/PhabricatorPHIDLookupController.php
@@ -13,12 +13,12 @@ final class PhabricatorPHIDLookupController
$rows = array();
foreach ($handles as $handle) {
if ($handle->getURI()) {
- $link = phutil_render_tag(
+ $link = phutil_tag(
'a',
array(
'href' => $handle->getURI(),
),
- phutil_escape_html($handle->getURI()));
+ $handle->getURI());
} else {
$link = null;
}
diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php
index c3a3b30f67..bf7c620be9 100644
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php
@@ -18,13 +18,13 @@ final class PhabricatorXHPASTViewStreamController
$name = $token->getTypeName();
$title = "Token {$seq}: {$name}";
- $tokens[] = phutil_render_tag(
+ $tokens[] = phutil_tag(
'span',
array(
'title' => $title,
'class' => 'token',
),
- phutil_escape_html($token->getValue()));
+ $token->getValue());
}
return $this->buildXHPASTViewPanelResponse(implode('', $tokens));
diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php
index 2e07a0317e..5b7673386e 100644
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php
@@ -29,12 +29,12 @@ final class PhabricatorXHPASTViewTreeController
$tree = array();
$tree[] =
''.$this->buildTree($child).'
';
diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php
index ee03806fac..2702854661 100644
--- a/src/applications/phriction/controller/PhrictionDiffController.php
+++ b/src/applications/phriction/controller/PhrictionDiffController.php
@@ -104,12 +104,12 @@ final class PhrictionDiffController
$crumbs->setCrumbs(
array(
'Phriction',
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => PhrictionDocument::getSlugURI($slug),
),
- phutil_escape_html($current->getTitle())),
+ $current->getTitle()),
phutil_render_tag(
'a',
array(
diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php
index 7b7a88fd98..f48e562d18 100644
--- a/src/applications/phriction/controller/PhrictionDocumentController.php
+++ b/src/applications/phriction/controller/PhrictionDocumentController.php
@@ -341,12 +341,12 @@ final class PhrictionDocumentController
private function renderChildDocumentLink(array $info) {
$title = nonempty($info['title'], '(Untitled Document)');
- $item = phutil_render_tag(
+ $item = phutil_tag(
'a',
array(
'href' => PhrictionDocument::getSlugURI($info['slug']),
),
- phutil_escape_html($title));
+ $title);
if (isset($info['empty'])) {
$item = ''.$item.'';
diff --git a/src/applications/phriction/controller/PhrictionListController.php b/src/applications/phriction/controller/PhrictionListController.php
index abd90432e9..65bfefe701 100644
--- a/src/applications/phriction/controller/PhrictionListController.php
+++ b/src/applications/phriction/controller/PhrictionListController.php
@@ -53,12 +53,12 @@ final class PhrictionListController
$content = $document->getContent();
$rows[] = array(
$handles[$content->getAuthorPHID()]->renderLink(),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => PhrictionDocument::getSlugURI($document->getSlug()),
),
- phutil_escape_html($content->getTitle())),
+ $content->getTitle()),
phabricator_date($content->getDateCreated(), $user),
phabricator_time($content->getDateCreated(), $user),
);
diff --git a/src/applications/policy/filter/PhabricatorPolicy.php b/src/applications/policy/filter/PhabricatorPolicy.php
index b901efbfbc..305cae4cd1 100644
--- a/src/applications/policy/filter/PhabricatorPolicy.php
+++ b/src/applications/policy/filter/PhabricatorPolicy.php
@@ -77,12 +77,12 @@ final class PhabricatorPolicy {
public function renderDescription() {
if ($this->getHref()) {
- $desc = phutil_render_tag(
+ $desc = phutil_tag(
'a',
array(
'href' => $this->getHref(),
),
- phutil_escape_html($this->getName()));
+ $this->getName());
} else {
$desc = phutil_escape_html($this->getName());
}
diff --git a/src/applications/ponder/view/PonderQuestionSummaryView.php b/src/applications/ponder/view/PonderQuestionSummaryView.php
index cc03d6d138..a06cdcc46d 100644
--- a/src/applications/ponder/view/PonderQuestionSummaryView.php
+++ b/src/applications/ponder/view/PonderQuestionSummaryView.php
@@ -48,15 +48,13 @@ final class PonderQuestionSummaryView extends AphrontView {
$title =
''.
- phutil_render_tag(
+ phutil_tag(
'a',
array(
"href" => '/Q' . $question->getID(),
),
- phutil_escape_html(
'Q' . $question->getID() .
' ' . $question->getTitle()
- )
) .
'
';
diff --git a/src/applications/project/controller/PhabricatorProjectListController.php b/src/applications/project/controller/PhabricatorProjectListController.php
index ca215fdf19..869a7c2404 100644
--- a/src/applications/project/controller/PhabricatorProjectListController.php
+++ b/src/applications/project/controller/PhabricatorProjectListController.php
@@ -100,22 +100,22 @@ final class PhabricatorProjectListController
$rows[] = array(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/project/view/'.$project->getID().'/',
),
- phutil_escape_html($project->getName())),
+ $project->getName()),
phutil_escape_html(
PhabricatorProjectStatus::getNameForStatus($project->getStatus())),
phutil_escape_html($blurb),
phutil_escape_html($population),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/maniphest/view/all/?projects='.$phid,
),
- phutil_escape_html($task_count)),
+ $task_count),
);
}
diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelProfile.php b/src/applications/settings/panel/PhabricatorSettingsPanelProfile.php
index 692636405f..0ade8c291a 100644
--- a/src/applications/settings/panel/PhabricatorSettingsPanelProfile.php
+++ b/src/applications/settings/panel/PhabricatorSettingsPanelProfile.php
@@ -160,12 +160,12 @@ final class PhabricatorSettingsPanelProfile
id(new AphrontFormMarkupControl())
->setLabel('Profile URI')
->setValue(
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $profile_uri,
),
- phutil_escape_html($profile_uri))))
+ $profile_uri)))
->appendChild(
'
';
}
diff --git a/src/applications/xhprof/view/PhabricatorXHProfProfileView.php b/src/applications/xhprof/view/PhabricatorXHProfProfileView.php
index f4df87a422..fd06a49fdc 100644
--- a/src/applications/xhprof/view/PhabricatorXHProfProfileView.php
+++ b/src/applications/xhprof/view/PhabricatorXHProfProfileView.php
@@ -16,13 +16,13 @@ abstract class PhabricatorXHProfProfileView extends AphrontView {
}
protected function renderSymbolLink($symbol) {
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => $this->baseURI.'?symbol='.$symbol,
'target' => $this->isFramed ? '_top' : null,
),
- phutil_escape_html($symbol));
+ $symbol);
}
}
diff --git a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMention.php b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMention.php
index 1591d0b62b..f68d05fb64 100644
--- a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMention.php
+++ b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMention.php
@@ -95,7 +95,7 @@ final class PhabricatorRemarkupRuleMention
}
if ($exists) {
- $tag = phutil_render_tag(
+ $tag = phutil_tag(
'a',
array(
'class' => $class,
@@ -103,7 +103,7 @@ final class PhabricatorRemarkupRuleMention
'target' => '_blank',
'title' => $actual_users[$username]['realName'],
),
- phutil_escape_html('@'.$actual_users[$username]['username']));
+ '@'.$actual_users[$username]['username']);
foreach ($tokens as $token) {
$engine->overwriteStoredText($token, $tag);
}
@@ -112,12 +112,12 @@ final class PhabricatorRemarkupRuleMention
// because we want to preserve the original text capitalization and it
// may differ for each token.
foreach ($tokens as $token) {
- $tag = phutil_render_tag(
+ $tag = phutil_tag(
'span',
array(
'class' => $class,
),
- phutil_escape_html('@'.idx($original, $token, $username)));
+ '@'.idx($original, $token, $username));
$engine->overwriteStoredText($token, $tag);
}
}
diff --git a/src/infrastructure/markup/rule/PhabricatorRemarkupRulePhriction.php b/src/infrastructure/markup/rule/PhabricatorRemarkupRulePhriction.php
index 04a10bed91..410d507b47 100644
--- a/src/infrastructure/markup/rule/PhabricatorRemarkupRulePhriction.php
+++ b/src/infrastructure/markup/rule/PhabricatorRemarkupRulePhriction.php
@@ -30,13 +30,13 @@ final class PhabricatorRemarkupRulePhriction
if ($this->getEngine()->getState('toc')) {
$text = phutil_escape_html($name);
} else {
- $text = phutil_render_tag(
+ $text = phutil_tag(
'a',
array(
'href' => $href,
'class' => 'phriction-link',
),
- phutil_escape_html($name));
+ $name);
}
return $this->getEngine()->storeText($text);
diff --git a/src/view/control/AphrontAttachedFileView.php b/src/view/control/AphrontAttachedFileView.php
index 499162ba63..a728515387 100644
--- a/src/view/control/AphrontAttachedFileView.php
+++ b/src/view/control/AphrontAttachedFileView.php
@@ -23,13 +23,13 @@ final class AphrontAttachedFileView extends AphrontView {
'height' => 45,
));
- $name = phutil_render_tag(
+ $name = phutil_tag(
'a',
array(
'href' => $file->getViewURI(),
'target' => '_blank',
),
- phutil_escape_html($file->getName()));
+ $file->getName());
$size = number_format($file->getByteSize()).' bytes';
$remove = javelin_render_tag(
diff --git a/src/view/control/AphrontTableView.php b/src/view/control/AphrontTableView.php
index b5f4f826a4..c3bffde73f 100644
--- a/src/view/control/AphrontTableView.php
+++ b/src/view/control/AphrontTableView.php
@@ -210,12 +210,12 @@ final class AphrontTableView extends AphrontView {
'class' => 'aphront-table-view-nodevice',
),
$header);
- $header_device = phutil_render_tag(
+ $header_device = phutil_tag(
'span',
array(
'class' => 'aphront-table-view-device',
),
- phutil_escape_html($short_headers[$col_num]));
+ $short_headers[$col_num]);
$header = $header_nodevice.$header_device;
}
diff --git a/src/view/form/AphrontErrorView.php b/src/view/form/AphrontErrorView.php
index 632561ddec..d3dc20a0a3 100644
--- a/src/view/form/AphrontErrorView.php
+++ b/src/view/form/AphrontErrorView.php
@@ -40,10 +40,10 @@ final class AphrontErrorView extends AphrontView {
if ($errors) {
$list = array();
foreach ($errors as $error) {
- $list[] = phutil_render_tag(
+ $list[] = phutil_tag(
'li',
array(),
- phutil_escape_html($error));
+ $error);
}
$list = phutil_render_tag(
'ul',
@@ -57,12 +57,12 @@ final class AphrontErrorView extends AphrontView {
$title = $this->title;
if (strlen($title)) {
- $title = phutil_render_tag(
+ $title = phutil_tag(
'h1',
array(
'class' => 'aphront-error-view-head',
),
- phutil_escape_html($title));
+ $title);
} else {
$title = null;
}
diff --git a/src/view/form/control/AphrontFormCheckboxControl.php b/src/view/form/control/AphrontFormCheckboxControl.php
index d2d05e77a3..00a85f52a9 100644
--- a/src/view/form/control/AphrontFormCheckboxControl.php
+++ b/src/view/form/control/AphrontFormCheckboxControl.php
@@ -32,12 +32,12 @@ final class AphrontFormCheckboxControl extends AphrontFormControl {
'checked' => $box['checked'] ? 'checked' : null,
'disabled' => $this->getDisabled() ? 'disabled' : null,
));
- $label = phutil_render_tag(
+ $label = phutil_tag(
'label',
array(
'for' => $id,
),
- phutil_escape_html($box['label']));
+ $box['label']);
$rows[] =
''.
' ';
}
- $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[] = ''.$checkbox.' '.
diff --git a/src/view/form/control/AphrontFormRadioButtonControl.php b/src/view/form/control/AphrontFormRadioButtonControl.php
index e15dd03c8d..6d6547c8b6 100644
--- a/src/view/form/control/AphrontFormRadioButtonControl.php
+++ b/src/view/form/control/AphrontFormRadioButtonControl.php
@@ -34,13 +34,13 @@ final class AphrontFormRadioButtonControl extends AphrontFormControl {
: null,
'disabled' => $this->getDisabled() ? 'disabled' : null,
));
- $label = phutil_render_tag(
+ $label = phutil_tag(
'label',
array(
'for' => $id,
'class' => $button['class'],
),
- phutil_escape_html($button['label']));
+ $button['label']);
if (strlen($button['caption'])) {
$label .=
diff --git a/src/view/form/control/AphrontFormSelectControl.php b/src/view/form/control/AphrontFormSelectControl.php
index 419d8ea352..bc01e742b3 100644
--- a/src/view/form/control/AphrontFormSelectControl.php
+++ b/src/view/form/control/AphrontFormSelectControl.php
@@ -52,13 +52,13 @@ final class AphrontFormSelectControl extends AphrontFormControl {
),
implode("\n", self::renderOptions($selected, $thing)));
} else {
- $tags[] = phutil_render_tag(
+ $tags[] = phutil_tag(
'option',
array(
'selected' => ($value == $selected) ? 'selected' : null,
'value' => $value,
),
- phutil_escape_html($thing));
+ $thing);
}
}
return $tags;
diff --git a/src/view/form/control/AphrontFormSubmitControl.php b/src/view/form/control/AphrontFormSubmitControl.php
index 9ec7593dcd..c2ccb915e5 100644
--- a/src/view/form/control/AphrontFormSubmitControl.php
+++ b/src/view/form/control/AphrontFormSubmitControl.php
@@ -5,13 +5,13 @@ final class AphrontFormSubmitControl extends AphrontFormControl {
protected $cancelButton;
public function addCancelButton($href, $label = 'Cancel') {
- $this->cancelButton = phutil_render_tag(
+ $this->cancelButton = phutil_tag(
'a',
array(
'href' => $href,
'class' => 'button grey',
),
- phutil_escape_html($label));
+ $label);
return $this;
}
@@ -22,13 +22,13 @@ final class AphrontFormSubmitControl extends AphrontFormControl {
protected function renderInput() {
$submit_button = null;
if ($this->getValue()) {
- $submit_button = phutil_render_tag(
+ $submit_button = phutil_tag(
'button',
array(
'name' => '__submit__',
'disabled' => $this->getDisabled() ? 'disabled' : null,
),
- phutil_escape_html($this->getValue()));
+ $this->getValue());
}
return $submit_button.$this->cancelButton;
}
diff --git a/src/view/form/control/AphrontFormTextAreaControl.php b/src/view/form/control/AphrontFormTextAreaControl.php
index 921d8caef3..311beaea8e 100644
--- a/src/view/form/control/AphrontFormTextAreaControl.php
+++ b/src/view/form/control/AphrontFormTextAreaControl.php
@@ -61,7 +61,7 @@ class AphrontFormTextAreaControl extends AphrontFormControl {
$classes[] = $this->customClass;
$classes = trim(implode(' ', $classes));
- return phutil_render_tag(
+ return phutil_tag(
'textarea',
array(
'name' => $this->getName(),
@@ -72,7 +72,7 @@ class AphrontFormTextAreaControl extends AphrontFormControl {
'id' => $this->getID(),
'placeholder' => $this->getPlaceHolder(),
),
- phutil_escape_html($this->getValue()));
+ $this->getValue());
}
}
diff --git a/src/view/form/control/AphrontFormToggleButtonsControl.php b/src/view/form/control/AphrontFormToggleButtonsControl.php
index f4ec32bacd..43f83ed1b9 100644
--- a/src/view/form/control/AphrontFormToggleButtonsControl.php
+++ b/src/view/form/control/AphrontFormToggleButtonsControl.php
@@ -37,13 +37,13 @@ final class AphrontFormToggleButtonsControl extends AphrontFormControl {
$more = null;
}
- $out[] = phutil_render_tag(
+ $out[] = phutil_tag(
'a',
array(
'class' => 'toggle'.$more,
'href' => $this->baseURI->alter($this->param, $value),
),
- phutil_escape_html($label));
+ $label);
}
return implode('', $out);
diff --git a/src/view/layout/PhabricatorActionView.php b/src/view/layout/PhabricatorActionView.php
index c148cc380d..30bbd218f2 100644
--- a/src/view/layout/PhabricatorActionView.php
+++ b/src/view/layout/PhabricatorActionView.php
@@ -92,12 +92,12 @@ final class PhabricatorActionView extends AphrontView {
phutil_escape_html($this->name));
}
} else {
- $item = phutil_render_tag(
+ $item = phutil_tag(
'span',
array(
'class' => 'phabricator-action-view-item',
),
- phutil_escape_html($this->name));
+ $this->name);
}
$classes = array();
diff --git a/src/view/layout/PhabricatorHeaderView.php b/src/view/layout/PhabricatorHeaderView.php
index 97d26bd6b9..8d2d7a911b 100644
--- a/src/view/layout/PhabricatorHeaderView.php
+++ b/src/view/layout/PhabricatorHeaderView.php
@@ -27,12 +27,12 @@ final class PhabricatorHeaderView extends AphrontView {
$header = phutil_escape_html($this->header);
if ($this->objectName) {
- $header = phutil_render_tag(
+ $header = phutil_tag(
'a',
array(
'href' => '/'.$this->objectName,
),
- phutil_escape_html($this->objectName)).' '.$header;
+ $this->objectName).' '.$header;
}
if ($this->tags) {
diff --git a/src/view/layout/PhabricatorMenuItemView.php b/src/view/layout/PhabricatorMenuItemView.php
index 69f4d1db76..768ee2a709 100644
--- a/src/view/layout/PhabricatorMenuItemView.php
+++ b/src/view/layout/PhabricatorMenuItemView.php
@@ -117,12 +117,12 @@ final class PhabricatorMenuItemView extends AphrontTagView {
if ($this->isExternal) {
$external = " \xE2\x86\x97";
}
- $name = phutil_render_tag(
+ $name = phutil_tag(
'span',
array(
'class' => 'phabricator-menu-item-name',
),
- phutil_escape_html($this->name.$external));
+ $this->name.$external);
}
return $this->renderChildren().$name;
diff --git a/src/view/layout/PhabricatorObjectItemListView.php b/src/view/layout/PhabricatorObjectItemListView.php
index 8b5f933d7a..a145b7ba43 100644
--- a/src/view/layout/PhabricatorObjectItemListView.php
+++ b/src/view/layout/PhabricatorObjectItemListView.php
@@ -32,12 +32,12 @@ final class PhabricatorObjectItemListView extends AphrontView {
$header = null;
if (strlen($this->header)) {
- $header = phutil_render_tag(
+ $header = phutil_tag(
'h1',
array(
'class' => 'phabricator-object-item-list-header',
),
- phutil_escape_html($this->header));
+ $this->header);
}
if ($this->items) {
diff --git a/src/view/layout/PhabricatorObjectItemView.php b/src/view/layout/PhabricatorObjectItemView.php
index ae40e59117..6161073f84 100644
--- a/src/view/layout/PhabricatorObjectItemView.php
+++ b/src/view/layout/PhabricatorObjectItemView.php
@@ -71,13 +71,13 @@ final class PhabricatorObjectItemView extends AphrontView {
}
public function render() {
- $header = phutil_render_tag(
+ $header = phutil_tag(
'a',
array(
'href' => $this->href,
'class' => 'phabricator-object-item-name',
),
- phutil_escape_html($this->header));
+ $this->header);
$icons = null;
if ($this->icons) {
@@ -93,12 +93,12 @@ final class PhabricatorObjectItemView extends AphrontView {
),
'');
- $label = phutil_render_tag(
+ $label = phutil_tag(
'span',
array(
'class' => 'phabricator-object-item-icon-label',
),
- phutil_escape_html($spec['label']));
+ $spec['label']);
$icon_list[] = phutil_render_tag(
'li',
diff --git a/src/view/layout/PhabricatorPropertyListView.php b/src/view/layout/PhabricatorPropertyListView.php
index 8110791673..4fb140b04b 100644
--- a/src/view/layout/PhabricatorPropertyListView.php
+++ b/src/view/layout/PhabricatorPropertyListView.php
@@ -87,12 +87,12 @@ final class PhabricatorPropertyListView extends AphrontView {
$key = $spec['key'];
$value = $spec['value'];
- $items[] = phutil_render_tag(
+ $items[] = phutil_tag(
'dt',
array(
'class' => 'phabricator-property-list-key',
),
- phutil_escape_html($key));
+ $key);
$items[] = phutil_render_tag(
'dd',
array(
@@ -137,12 +137,12 @@ final class PhabricatorPropertyListView extends AphrontView {
}
private function renderSectionPart(array $part) {
- return phutil_render_tag(
+ return phutil_tag(
'div',
array(
'class' => 'phabricator-property-list-section-header',
),
- phutil_escape_html($part['name']));
+ $part['name']);
}
private function renderTextPart(array $part) {
diff --git a/src/view/layout/PhabricatorTransactionView.php b/src/view/layout/PhabricatorTransactionView.php
index 4e6ab0d4ca..64e5bf54d1 100644
--- a/src/view/layout/PhabricatorTransactionView.php
+++ b/src/view/layout/PhabricatorTransactionView.php
@@ -105,12 +105,12 @@ final class PhabricatorTransactionView extends AphrontView {
->setAnchorName($this->anchorName)
->render();
- $info[] = $anchor.phutil_render_tag(
+ $info[] = $anchor.phutil_tag(
'a',
array(
'href' => '#'.$this->anchorName,
),
- phutil_escape_html($this->anchorText));
+ $this->anchorText);
}
$info = implode(' · ', $info);
diff --git a/src/view/layout/headsup/AphrontHeadsupView.php b/src/view/layout/headsup/AphrontHeadsupView.php
index ba6fa8c827..9e3b8f0896 100644
--- a/src/view/layout/headsup/AphrontHeadsupView.php
+++ b/src/view/layout/headsup/AphrontHeadsupView.php
@@ -30,13 +30,13 @@ final class AphrontHeadsupView extends AphrontView {
public function render() {
$header =
''.
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/'.$this->objectName,
'class' => 'aphront-headsup-object-name',
),
- phutil_escape_html($this->objectName)).
+ $this->objectName).
' '.
phutil_escape_html($this->header).
'
';
diff --git a/src/view/page/menu/PhabricatorMainMenuView.php b/src/view/page/menu/PhabricatorMainMenuView.php
index f3c3596719..588467aca6 100644
--- a/src/view/page/menu/PhabricatorMainMenuView.php
+++ b/src/view/page/menu/PhabricatorMainMenuView.php
@@ -303,13 +303,13 @@ final class PhabricatorMainMenuView extends AphrontView {
$count_number = "\xE2\x88\x9E";
}
- $count_tag = phutil_render_tag(
+ $count_tag = phutil_tag(
'span',
array(
'id' => $count_id,
'class' => 'phabricator-main-menu-alert-count'
),
- phutil_escape_html($count_number));
+ $count_number);
$icon_tag = phutil_render_tag(
'span',
--
2.51.2
From 20768d65d5660c7fdc8c14dc7245339915feada8 Mon Sep 17 00:00:00 2001
From: vrana '.$prev_link.' ';
diff --git a/src/applications/countdown/controller/PhabricatorCountdownListController.php b/src/applications/countdown/controller/PhabricatorCountdownListController.php
index 47cc610c6d..b015eb602f 100644
--- a/src/applications/countdown/controller/PhabricatorCountdownListController.php
+++ b/src/applications/countdown/controller/PhabricatorCountdownListController.php
@@ -28,7 +28,7 @@ final class PhabricatorCountdownListController
$delete_button = null;
if ($user->getIsAdmin() ||
($user->getPHID() == $timer->getAuthorPHID())) {
- $edit_button = phutil_render_tag(
+ $edit_button = phutil_tag(
'a',
array(
'class' => 'small button grey',
diff --git a/src/applications/daemon/controller/PhabricatorDaemonConsoleController.php b/src/applications/daemon/controller/PhabricatorDaemonConsoleController.php
index da5e439979..26059e4ce2 100644
--- a/src/applications/daemon/controller/PhabricatorDaemonConsoleController.php
+++ b/src/applications/daemon/controller/PhabricatorDaemonConsoleController.php
@@ -81,7 +81,7 @@ final class PhabricatorDaemonConsoleController
$task->getLeaseOwner(),
$task->getLeaseExpires() - time(),
$task->getFailureCount(),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/daemon/task/'.$task->getID().'/',
diff --git a/src/applications/daemon/view/PhabricatorDaemonLogListView.php b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
index c3f856d2ca..35f234733a 100644
--- a/src/applications/daemon/view/PhabricatorDaemonLogListView.php
+++ b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
@@ -81,7 +81,7 @@ final class PhabricatorDaemonLogListView extends AphrontView {
$log->getPID(),
phabricator_date($epoch, $this->user),
phabricator_time($epoch, $this->user),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/daemon/log/'.$log->getID().'/',
diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php
index 76fc629dbd..054e69cb90 100644
--- a/src/applications/differential/controller/DifferentialDiffCreateController.php
+++ b/src/applications/differential/controller/DifferentialDiffCreateController.php
@@ -30,7 +30,7 @@ final class DifferentialDiffCreateController extends DifferentialController {
$form = new AphrontFormView();
$arcanist_href = PhabricatorEnv::getDoclink(
'article/Arcanist_User_Guide.html');
- $arcanist_link = phutil_render_tag(
+ $arcanist_link = phutil_tag(
'a',
array(
'href' => $arcanist_href,
diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
index 9cbead02b4..7f6d6057c3 100644
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -184,7 +184,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
'
diff --git a/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php b/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php
index 98ec21feb3..b519c3e955 100644
--- a/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php
@@ -146,7 +146,7 @@ final class DifferentialReviewersFieldSpecification
$names[] = phutil_escape_html(
$this->getHandle($reviewer)->getLinkName());
}
- $suffix = ' '.javelin_render_tag(
+ $suffix = ' '.javelin_tag(
'abbr',
array(
'sigil' => 'has-tooltip',
diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
index 22bdc721e3..1a60831ac9 100644
--- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
+++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
@@ -321,7 +321,7 @@ abstract class DifferentialChangesetHTMLRenderer
$more = null;
if ($force !== 'none') {
- $more = ' '.javelin_render_tag(
+ $more = ' '.javelin_tag(
'a',
array(
'mustcapture' => true,
diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
index 20c2920e6e..cb22b44341 100644
--- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
+++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
@@ -16,7 +16,7 @@ final class DifferentialChangesetTwoUpRenderer
$context_not_available = null;
if ($hunk_starts) {
- $context_not_available = javelin_render_tag(
+ $context_not_available = javelin_tag(
'tr',
array(
'sigil' => 'context-target',
@@ -83,7 +83,7 @@ final class DifferentialChangesetTwoUpRenderer
$is_first_block = true;
}
- $contents[] = javelin_render_tag(
+ $contents[] = javelin_tag(
'a',
array(
'href' => '#',
@@ -99,7 +99,7 @@ final class DifferentialChangesetTwoUpRenderer
: pht("\xE2\x96\xB2 Show 20 Lines"));
}
- $contents[] = javelin_render_tag(
+ $contents[] = javelin_tag(
'a',
array(
'href' => '#',
@@ -119,7 +119,7 @@ final class DifferentialChangesetTwoUpRenderer
}
if ($len > 40) {
- $contents[] = javelin_render_tag(
+ $contents[] = javelin_tag(
'a',
array(
'href' => '#',
@@ -235,7 +235,7 @@ final class DifferentialChangesetTwoUpRenderer
dirname('/'.$orig_file);
}
$class = ($orig_type == '-' ? 'new-move' : 'new-copy');
- $n_copy = javelin_render_tag(
+ $n_copy = javelin_tag(
'td',
array(
'meta' => array(
diff --git a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
index 1d5be8e265..6ee62cc218 100644
--- a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
+++ b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
@@ -104,7 +104,7 @@ final class DifferentialChangesetFileTreeSideNavBuilder {
),
$name);
- $filetree[] = javelin_render_tag(
+ $filetree[] = javelin_tag(
$href ? 'a' : 'span',
array(
'href' => $href,
@@ -112,7 +112,7 @@ final class DifferentialChangesetFileTreeSideNavBuilder {
'title' => $title,
'class' => 'phabricator-filetree-item',
),
- $icon.$name_element);
+ array($icon, $name_element));
}
$tree->destroy();
diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php
index acea5b060d..abbca39906 100644
--- a/src/applications/differential/view/DifferentialChangesetListView.php
+++ b/src/applications/differential/view/DifferentialChangesetListView.php
@@ -143,7 +143,7 @@ final class DifferentialChangesetListView extends AphrontView {
$load = 'Loading...';
$mapping[$uniq_id] = $ref;
} else {
- $load = javelin_render_tag(
+ $load = javelin_tag(
'a',
array(
'href' => '#'.$uniq_id,
@@ -155,7 +155,7 @@ final class DifferentialChangesetListView extends AphrontView {
'sigil' => 'differential-load',
'mustcapture' => true,
),
- 'Load');
+ pht('Load'));
}
$detail->appendChild(
phutil_tag(
@@ -209,13 +209,13 @@ final class DifferentialChangesetListView extends AphrontView {
* Render the "Undo" markup for the inline comment undo feature.
*/
private function renderUndoTemplates() {
- $link = javelin_render_tag(
+ $link = javelin_tag(
'a',
array(
'href' => '#',
'sigil' => 'differential-inline-comment-undo',
),
- 'Undo');
+ pht('Undo'));
$div = phutil_tag(
'div',
@@ -302,7 +302,7 @@ final class DifferentialChangesetListView extends AphrontView {
'differential-dropdown-menus',
array());
- return javelin_render_tag(
+ return javelin_tag(
'a',
array(
'class' => 'button small grey',
@@ -311,7 +311,7 @@ final class DifferentialChangesetListView extends AphrontView {
'target' => '_blank',
'sigil' => 'differential-view-options',
),
- "View Options \xE2\x96\xBC");
+ pht("View Options \xE2\x96\xBC"));
}
}
diff --git a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
index 818522b2ba..75de304237 100644
--- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
+++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
@@ -192,16 +192,14 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
}
}
- $reveal_link =
- javelin_render_tag(
+ $reveal_link = javelin_tag(
'a',
array(
'sigil' => 'differential-reveal-all',
'mustcapture' => true,
'class' => 'button differential-toc-reveal-all',
),
- pht('Show All Context')
- );
+ pht('Show All Context'));
$buttons =
''.
diff --git a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
index 2c5d5058af..818522b2ba 100644
--- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
+++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
@@ -137,7 +137,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
if ($cov === null) {
$mcov = $cov = '-';
} else {
- $mcov = phutil_render_tag(
+ $mcov = phutil_tag(
'div',
array(
'id' => 'differential-mcoverage-'.md5($fname),
diff --git a/src/applications/differential/view/DifferentialRevisionCommentView.php b/src/applications/differential/view/DifferentialRevisionCommentView.php
index 0670e87bdb..251c6d12fd 100644
--- a/src/applications/differential/view/DifferentialRevisionCommentView.php
+++ b/src/applications/differential/view/DifferentialRevisionCommentView.php
@@ -134,12 +134,12 @@ final class DifferentialRevisionCommentView extends AphrontView {
case DifferentialAction::ACTION_UPDATE:
$diff_id = idx($metadata, DifferentialComment::METADATA_DIFF_ID);
if ($diff_id) {
- $diff_link = phutil_render_tag(
+ $diff_link = phutil_tag(
'a',
array(
'href' => '/D'.$comment->getRevisionID().'?id='.$diff_id,
),
- 'Diff #'.phutil_escape_html($diff_id));
+ 'Diff #'.$diff_id);
$actions[] = "{$author_link} updated this revision to {$diff_link}.";
} else {
$actions[] = "{$author_link} {$verb} this revision.";
diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php
index b0565ca6ce..62d247a651 100644
--- a/src/applications/diffusion/controller/DiffusionBrowseController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseController.php
@@ -108,7 +108,7 @@ final class DiffusionBrowseController extends DiffusionController {
$engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine();
$text = $engine->markupText($text);
- $text = phutil_render_tag(
+ $text = phutil_tag(
'div',
array(
'class' => 'phabricator-remarkup',
diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
index c0835332f4..36bc8443a3 100644
--- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -271,7 +271,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
'sigil' => 'diffusion-source',
),
implode("\n", $rows));
- $corpus = phutil_render_tag(
+ $corpus = phutil_tag(
'div',
array(
'style' => 'padding: 0 2em;',
@@ -666,7 +666,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
"\xC2\xAB");
}
- $blame[] = phutil_render_tag(
+ $blame[] = phutil_tag(
'th',
array(
'class' => 'diffusion-blame-link',
@@ -674,7 +674,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
),
$before_link);
- $blame[] = phutil_render_tag(
+ $blame[] = phutil_tag(
'th',
array(
'class' => 'diffusion-rev-link',
@@ -682,7 +682,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
),
$commit_link);
- $blame[] = phutil_render_tag(
+ $blame[] = phutil_tag(
'th',
array(
'class' => 'diffusion-rev-link',
@@ -690,7 +690,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
),
$revision_link);
- $blame[] = phutil_render_tag(
+ $blame[] = phutil_tag(
'th',
array(
'class' => 'diffusion-author-link',
@@ -717,8 +717,6 @@ final class DiffusionBrowseFileController extends DiffusionController {
Javelin::initBehavior('diffusion-line-linker');
- $blame = implode('', $blame);
-
if ($line['target']) {
Javelin::initBehavior(
'diffusion-jump-to',
@@ -730,7 +728,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
$anchor_text = null;
}
- $line_text = phutil_render_tag(
+ $blame[] = phutil_render_tag(
'td',
array(
),
@@ -738,13 +736,12 @@ final class DiffusionBrowseFileController extends DiffusionController {
"\xE2\x80\x8B". // NOTE: See phabricator-oncopy behavior.
$line['data']);
- $rows[] = phutil_render_tag(
+ $rows[] = phutil_tag(
'tr',
array(
'class' => ($line['highlighted'] ? 'highlighted' : null),
),
- $blame.
- $line_text);
+ $blame);
$rows = array_merge($rows, $this->renderInlines(
idx($inlines, $line['line'], array()),
diff --git a/src/applications/diffusion/controller/DiffusionHomeController.php b/src/applications/diffusion/controller/DiffusionHomeController.php
index d06f0d9863..93d0330414 100644
--- a/src/applications/diffusion/controller/DiffusionHomeController.php
+++ b/src/applications/diffusion/controller/DiffusionHomeController.php
@@ -105,7 +105,7 @@ final class DiffusionHomeController extends DiffusionController {
$branch = $repository->getDefaultArcanistBranch();
if (isset($lint_branches[$branch])) {
$show_lint = true;
- $lint_count = phutil_render_tag(
+ $lint_count = phutil_tag(
'a',
array(
'href' => DiffusionRequest::generateDiffusionURI(array(
diff --git a/src/applications/diffusion/view/DiffusionBrowseTableView.php b/src/applications/diffusion/view/DiffusionBrowseTableView.php
index 2aed5dbdd3..e603b1aade 100644
--- a/src/applications/diffusion/view/DiffusionBrowseTableView.php
+++ b/src/applications/diffusion/view/DiffusionBrowseTableView.php
@@ -137,7 +137,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
$browse_link = ''.$this->linkBrowse(
$base_path.$path->getPath().$dir_slash,
array(
- 'html' => $this->renderPathIcon(
+ 'text' => $this->renderPathIcon(
'dir',
$browse_text),
)).'';
@@ -162,7 +162,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
$browse_link = $this->linkBrowse(
$base_path.$path->getPath(),
array(
- 'html' => $this->renderPathIcon($type, $browse_text),
+ 'text' => $this->renderPathIcon($type, $browse_text),
));
}
diff --git a/src/applications/diffusion/view/DiffusionView.php b/src/applications/diffusion/view/DiffusionView.php
index df5f139307..83dff57748 100644
--- a/src/applications/diffusion/view/DiffusionView.php
+++ b/src/applications/diffusion/view/DiffusionView.php
@@ -32,7 +32,7 @@ abstract class DiffusionView extends AphrontView {
'commit' => $commit_identifier,
));
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => $href,
@@ -63,15 +63,13 @@ abstract class DiffusionView extends AphrontView {
'path' => $path,
));
- if (isset($details['html'])) {
- $text = $details['html'];
- } else if (isset($details['text'])) {
- $text = phutil_escape_html($details['text']);
+ if (isset($details['text'])) {
+ $text = $details['text'];
} else {
$text = 'Browse';
}
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => $href,
@@ -87,7 +85,7 @@ abstract class DiffusionView extends AphrontView {
'id' => $hash,
));
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => $href,
@@ -120,7 +118,7 @@ abstract class DiffusionView extends AphrontView {
$commit_name = self::nameCommit($repository, $commit);
$callsign = $repository->getCallsign();
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => "/r{$callsign}{$commit}",
@@ -133,7 +131,7 @@ abstract class DiffusionView extends AphrontView {
return null;
}
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => "/D{$id}",
diff --git a/src/applications/directory/controller/PhabricatorDirectoryMainController.php b/src/applications/directory/controller/PhabricatorDirectoryMainController.php
index 0302df17ec..b795ec238e 100644
--- a/src/applications/directory/controller/PhabricatorDirectoryMainController.php
+++ b/src/applications/directory/controller/PhabricatorDirectoryMainController.php
@@ -310,13 +310,14 @@ final class PhabricatorDirectoryMainController
'id' => $uniq_id,
'value' => $query,
));
- $jump_caption = phutil_render_tag(
+ $jump_caption = phutil_tag(
'p',
array(
'class' => 'phabricator-jump-nav-caption',
),
- 'Enter the name of an object like D123 to quickly jump to '.
- 'it. See '.$doc_link.' or type help.');
+ new PhutilSafeHTML(
+ 'Enter the name of an object like D123 to quickly jump to '.
+ 'it. See '.$doc_link.' or type help.'));
$panel = new AphrontPanelView();
$panel->setHeader('Jump Nav');
diff --git a/src/applications/feed/view/PhabricatorFeedStoryView.php b/src/applications/feed/view/PhabricatorFeedStoryView.php
index 72b4a2a795..bf23a53890 100644
--- a/src/applications/feed/view/PhabricatorFeedStoryView.php
+++ b/src/applications/feed/view/PhabricatorFeedStoryView.php
@@ -97,7 +97,7 @@ final class PhabricatorFeedStoryView extends PhabricatorFeedView {
$foot = '';
}
- $foot = phutil_render_tag(
+ $foot = phutil_tag(
'div',
array(
'class' => 'phabricator-feed-story-foot',
@@ -111,7 +111,7 @@ final class PhabricatorFeedStoryView extends PhabricatorFeedView {
require_celerity_resource('phabricator-feed-css');
- return phutil_render_tag(
+ return phutil_tag(
'div',
array(
'class' => $this->oneLine
@@ -119,7 +119,7 @@ final class PhabricatorFeedStoryView extends PhabricatorFeedView {
: 'phabricator-feed-story',
'style' => $image_style,
),
- $head.$body.$foot);
+ array($head, $body, $foot));
}
}
diff --git a/src/applications/files/controller/PhabricatorFileInfoController.php b/src/applications/files/controller/PhabricatorFileInfoController.php
index 26a095af51..cea2272bdb 100644
--- a/src/applications/files/controller/PhabricatorFileInfoController.php
+++ b/src/applications/files/controller/PhabricatorFileInfoController.php
@@ -148,7 +148,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
'class' => 'phabricator-property-list-image',
));
- $linked_image = phutil_render_tag(
+ $linked_image = phutil_tag(
'a',
array(
'href' => $file->getViewURI(),
diff --git a/src/applications/macro/controller/PhabricatorMacroListController.php b/src/applications/macro/controller/PhabricatorMacroListController.php
index 3756d346a0..4a7560ec89 100644
--- a/src/applications/macro/controller/PhabricatorMacroListController.php
+++ b/src/applications/macro/controller/PhabricatorMacroListController.php
@@ -129,7 +129,7 @@ final class PhabricatorMacroListController
}
$datetime = phabricator_date($file->getDateCreated(), $viewer);
$item->appendChild(
- phutil_render_tag(
+ phutil_tag(
'div',
array(),
pht('Created on %s', $datetime)));
diff --git a/src/applications/metamta/contentsource/PhabricatorContentSourceView.php b/src/applications/metamta/contentsource/PhabricatorContentSourceView.php
index 5cd1278770..81ffda8de8 100644
--- a/src/applications/metamta/contentsource/PhabricatorContentSourceView.php
+++ b/src/applications/metamta/contentsource/PhabricatorContentSourceView.php
@@ -28,7 +28,7 @@ final class PhabricatorContentSourceView extends AphrontView {
return;
}
- return phutil_render_tag(
+ return phutil_tag(
'span',
array(
'class' => "phabricator-content-source-view",
diff --git a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php
index 563a2816f4..c3b0a927af 100644
--- a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php
+++ b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php
@@ -57,7 +57,7 @@ extends PhabricatorOAuthClientAuthorizationBaseController {
),
$client->getName()
),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $scope_doc_href,
diff --git a/src/applications/phame/view/PhamePostView.php b/src/applications/phame/view/PhamePostView.php
index daae25dd53..582e32ccf7 100644
--- a/src/applications/phame/view/PhamePostView.php
+++ b/src/applications/phame/view/PhamePostView.php
@@ -123,26 +123,30 @@ final class PhamePostView extends AphrontView {
}
public function render() {
- return phutil_render_tag(
+ return phutil_tag(
'div',
array(
'class' => 'phame-post',
),
- $this->renderTitle().
- $this->renderDatePublished().
- $this->renderBody().
- $this->renderComments());
+ array(
+ $this->renderTitle(),
+ $this->renderDatePublished(),
+ $this->renderBody(),
+ $this->renderComments(),
+ ));
}
public function renderWithSummary() {
- return phutil_render_tag(
+ return phutil_tag(
'div',
array(
'class' => 'phame-post',
),
- $this->renderTitle().
- $this->renderDatePublished().
- $this->renderSummary());
+ array(
+ $this->renderTitle(),
+ $this->renderDatePublished(),
+ $this->renderSummary(),
+ ));
}
private function renderFacebookComments() {
diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php
index b24b00331b..1aa9625bf8 100644
--- a/src/applications/phriction/controller/PhrictionDiffController.php
+++ b/src/applications/phriction/controller/PhrictionDiffController.php
@@ -212,13 +212,13 @@ final class PhrictionDiffController
}
- return phutil_render_tag(
+ return phutil_tag(
'a',
array(
'href' => '/phriction/edit/'.$document_id.'/?revert='.$version,
'class' => 'button',
),
- 'Revert to Version '.phutil_escape_html($version).'...');
+ 'Revert to Version '.$version.'...');
}
private function renderComparisonTable(array $content) {
diff --git a/src/applications/phriction/controller/PhrictionHistoryController.php b/src/applications/phriction/controller/PhrictionHistoryController.php
index 29f92e4b0d..0f4bec40f7 100644
--- a/src/applications/phriction/controller/PhrictionHistoryController.php
+++ b/src/applications/phriction/controller/PhrictionHistoryController.php
@@ -82,7 +82,7 @@ final class PhrictionHistoryController
$rows[] = array(
phabricator_date($content->getDateCreated(), $user),
phabricator_time($content->getDateCreated(), $user),
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => $slug_uri.'?v='.$version,
diff --git a/src/applications/ponder/view/PonderCommentListView.php b/src/applications/ponder/view/PonderCommentListView.php
index 566a975ef6..bef9942aa5 100644
--- a/src/applications/ponder/view/PonderCommentListView.php
+++ b/src/applications/ponder/view/PonderCommentListView.php
@@ -83,12 +83,12 @@ final class PonderCommentListView extends AphrontView {
' ';
- $comment_markup = phutil_render_tag(
+ $comment_markup = phutil_tag(
'table',
array(
'class' => 'ponder-comments',
),
- implode("\n", $comment_markup)
+ new PhutilSafeHTML(implode("\n", $comment_markup))
);
diff --git a/src/applications/ponder/view/PonderUserProfileView.php b/src/applications/ponder/view/PonderUserProfileView.php
index 0bd15efcfc..a05796c0b8 100644
--- a/src/applications/ponder/view/PonderUserProfileView.php
+++ b/src/applications/ponder/view/PonderUserProfileView.php
@@ -79,7 +79,7 @@ final class PonderUserProfileView extends AphrontView {
$item->addAttribute(
pht(
'Answer to %s',
- phutil_render_tag(
+ phutil_tag(
'a',
array(
'href' => '/Q'.$question->getID(),
diff --git a/src/applications/search/view/PhabricatorSearchResultView.php b/src/applications/search/view/PhabricatorSearchResultView.php
index 8e82d4ae03..b2a1aaafa9 100644
--- a/src/applications/search/view/PhabricatorSearchResultView.php
+++ b/src/applications/search/view/PhabricatorSearchResultView.php
@@ -34,7 +34,7 @@ final class PhabricatorSearchResultView extends AphrontView {
require_celerity_resource('phabricator-search-results-css');
- $link = phutil_render_tag(
+ $link = phutil_tag(
'a',
array(
'href' => $handle->getURI(),
@@ -73,7 +73,7 @@ final class PhabricatorSearchResultView extends AphrontView {
''.$addview->render().' '.
''.
'
'.
- javelin_render_tag(
+ phutil_tag(
'a',
array(
'class' => 'dark-console-tab dark-console-tab-selected',
diff --git a/src/applications/calendar/view/AphrontCalendarMonthView.php b/src/applications/calendar/view/AphrontCalendarMonthView.php
index 5d175e7594..3367c01d88 100644
--- a/src/applications/calendar/view/AphrontCalendarMonthView.php
+++ b/src/applications/calendar/view/AphrontCalendarMonthView.php
@@ -291,7 +291,7 @@ final class AphrontCalendarMonthView extends AphrontView {
$href = null;
}
- $text_div = javelin_render_tag(
+ $text_div = javelin_tag(
$tag,
array(
'sigil' => 'has-tooltip',
@@ -302,9 +302,9 @@ final class AphrontCalendarMonthView extends AphrontView {
'class' => 'aphront-calendar-event-text',
'href' => $href,
),
- phutil_escape_html(phutil_utf8_shorten($event->getName(), 32)));
+ phutil_utf8_shorten($event->getName(), 32));
- return javelin_render_tag(
+ return javelin_tag(
'div',
array(
'class' => implode(' ', $classes),
diff --git a/src/applications/conpherence/controller/ConpherenceViewController.php b/src/applications/conpherence/controller/ConpherenceViewController.php
index 925843c45c..a36e1ab766 100644
--- a/src/applications/conpherence/controller/ConpherenceViewController.php
+++ b/src/applications/conpherence/controller/ConpherenceViewController.php
@@ -163,29 +163,33 @@ final class ConpherenceViewController extends
array(
'class' => 'widgets-header'
),
- javelin_render_tag(
- 'a',
- array(
- 'sigil' => 'conpherence-change-widget',
- 'meta' => array('widget' => 'widgets-files')
+ array(
+ javelin_tag(
+ 'a',
+ array(
+ 'sigil' => 'conpherence-change-widget',
+ 'meta' => array('widget' => 'widgets-files')
+ ),
+ pht('Files')
),
- pht('Files')
- ).' | '.
- javelin_render_tag(
- 'a',
- array(
- 'sigil' => 'conpherence-change-widget',
- 'meta' => array('widget' => 'widgets-tasks')
+ ' | ',
+ javelin_tag(
+ 'a',
+ array(
+ 'sigil' => 'conpherence-change-widget',
+ 'meta' => array('widget' => 'widgets-tasks')
+ ),
+ pht('Tasks')
),
- pht('Tasks')
- ).' | '.
- javelin_render_tag(
- 'a',
- array(
- 'sigil' => 'conpherence-change-widget',
- 'meta' => array('widget' => 'widgets-calendar')
+ ' | ',
+ javelin_tag(
+ 'a',
+ array(
+ 'sigil' => 'conpherence-change-widget',
+ 'meta' => array('widget' => 'widgets-calendar')
+ ),
+ pht('Calendar')
),
- pht('Calendar')
)
).
phutil_render_tag(
diff --git a/src/applications/countdown/controller/PhabricatorCountdownListController.php b/src/applications/countdown/controller/PhabricatorCountdownListController.php
index b015eb602f..93e4a916b7 100644
--- a/src/applications/countdown/controller/PhabricatorCountdownListController.php
+++ b/src/applications/countdown/controller/PhabricatorCountdownListController.php
@@ -36,7 +36,7 @@ final class PhabricatorCountdownListController
),
'Edit');
- $delete_button = javelin_render_tag(
+ $delete_button = javelin_tag(
'a',
array(
'class' => 'small button grey',
diff --git a/src/applications/countdown/controller/PhabricatorCountdownViewController.php b/src/applications/countdown/controller/PhabricatorCountdownViewController.php
index 494f918308..6e084a3835 100644
--- a/src/applications/countdown/controller/PhabricatorCountdownViewController.php
+++ b/src/applications/countdown/controller/PhabricatorCountdownViewController.php
@@ -47,13 +47,13 @@ final class PhabricatorCountdownViewController
Seconds
'.
- javelin_render_tag('td',
+ javelin_tag('td',
array('sigil' => 'phabricator-timer-days'), '').
- javelin_render_tag('td',
+ javelin_tag('td',
array('sigil' => 'phabricator-timer-hours'), '').
- javelin_render_tag('td',
+ javelin_tag('td',
array('sigil' => 'phabricator-timer-minutes'), '').
- javelin_render_tag('td',
+ javelin_tag('td',
array('sigil' => 'phabricator-timer-seconds'), '').
'
',
+ $comment_html);
}
}
}
diff --git a/src/applications/differential/view/DifferentialInlineCommentView.php b/src/applications/differential/view/DifferentialInlineCommentView.php
index 0340d3287a..0fa497fa59 100644
--- a/src/applications/differential/view/DifferentialInlineCommentView.php
+++ b/src/applications/differential/view/DifferentialInlineCommentView.php
@@ -175,10 +175,10 @@ final class DifferentialInlineCommentView extends AphrontView {
}
if ($links) {
- $links =
- ''.
- implode(' · ', $links).
- '';
+ $links = phutil_tag(
+ 'span',
+ array('class' => 'differential-inline-comment-links'),
+ array_interleave(" \xC2\xB7 ", $links));
} else {
$links = null;
}
@@ -217,24 +217,25 @@ final class DifferentialInlineCommentView extends AphrontView {
$author = $handles[$inline->getAuthorPHID()]->getName();
}
- $markup = javelin_render_tag(
+ $markup = javelin_tag(
'div',
array(
'class' => $classes,
'sigil' => $sigil,
'meta' => $metadata,
),
- ''.
@@ -256,7 +254,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
private function renderChangesetLink(DifferentialChangeset $changeset, $ref) {
$display_file = $changeset->getDisplayFilename();
- return javelin_render_tag(
+ return javelin_tag(
'a',
array(
'href' => '#'.$changeset->getAnchorName(),
@@ -266,7 +264,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
),
'sigil' => 'differential-load',
),
- phutil_escape_html($display_file));
+ $display_file);
}
}
diff --git a/src/applications/differential/view/DifferentialInlineCommentEditView.php b/src/applications/differential/view/DifferentialInlineCommentEditView.php
index 86a2706ce6..9471325c34 100644
--- a/src/applications/differential/view/DifferentialInlineCommentEditView.php
+++ b/src/applications/differential/view/DifferentialInlineCommentEditView.php
@@ -94,7 +94,7 @@ final class DifferentialInlineCommentEditView extends AphrontView {
$buttons = array();
$buttons[] = '';
- $buttons[] = javelin_render_tag(
+ $buttons[] = javelin_tag(
'button',
array(
'sigil' => 'inline-edit-cancel',
diff --git a/src/applications/differential/view/DifferentialInlineCommentView.php b/src/applications/differential/view/DifferentialInlineCommentView.php
index 09ac5a906b..0340d3287a 100644
--- a/src/applications/differential/view/DifferentialInlineCommentView.php
+++ b/src/applications/differential/view/DifferentialInlineCommentView.php
@@ -95,7 +95,7 @@ final class DifferentialInlineCommentView extends AphrontView {
}
if (!$this->preview) {
- $links[] = javelin_render_tag(
+ $links[] = javelin_tag(
'a',
array(
'href' => '#',
@@ -104,7 +104,7 @@ final class DifferentialInlineCommentView extends AphrontView {
),
pht('Previous'));
- $links[] = javelin_render_tag(
+ $links[] = javelin_tag(
'a',
array(
'href' => '#',
@@ -122,7 +122,7 @@ final class DifferentialInlineCommentView extends AphrontView {
// file/line information, and synthetic comments don't have an inline
// comment ID.
- $links[] = javelin_render_tag(
+ $links[] = javelin_tag(
'a',
array(
'href' => '#',
@@ -138,7 +138,7 @@ final class DifferentialInlineCommentView extends AphrontView {
$anchor_name = 'inline-'.$inline->getID();
if ($this->editable && !$this->preview) {
- $links[] = javelin_render_tag(
+ $links[] = javelin_tag(
'a',
array(
'href' => '#',
@@ -146,7 +146,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'sigil' => 'differential-inline-edit',
),
pht('Edit'));
- $links[] = javelin_render_tag(
+ $links[] = javelin_tag(
'a',
array(
'href' => '#',
@@ -155,7 +155,7 @@ final class DifferentialInlineCommentView extends AphrontView {
),
pht('Delete'));
} else if ($this->preview) {
- $links[] = javelin_render_tag(
+ $links[] = javelin_tag(
'a',
array(
'meta' => array(
@@ -164,7 +164,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'sigil' => 'differential-inline-preview-jump',
),
pht('Not Visible'));
- $links[] = javelin_render_tag(
+ $links[] = javelin_tag(
'a',
array(
'href' => '#',
diff --git a/src/applications/differential/view/DifferentialRevisionCommentListView.php b/src/applications/differential/view/DifferentialRevisionCommentListView.php
index 48d085a75d..8edeaeea81 100644
--- a/src/applications/differential/view/DifferentialRevisionCommentListView.php
+++ b/src/applications/differential/view/DifferentialRevisionCommentListView.php
@@ -166,7 +166,7 @@ final class DifferentialRevisionCommentListView extends AphrontView {
),
' ');
+ phutil_tag('th', array('colspan' => 2), $show_more));
- $rows[] = javelin_render_tag(
+ $rows[] = javelin_tag(
'tr',
array(
'class' => 'differential-results-row-show',
'sigil' => 'differential-results-row-hide',
'style' => 'display: none',
),
- ''.$hide_more.' ');
+ phutil_tag('th', array('colspan' => 2), $hide_more));
Javelin::initBehavior('differential-show-field-details');
}
--
2.51.2
From caa7fcef588b7901d211aa67849847faab0d0f9f Mon Sep 17 00:00:00 2001
From: epriestley
', $links);
+ return array_interleave(phutil_tag('br'), $links);
}
private function getCommitPHIDs() {
diff --git a/src/applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php b/src/applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php
index 6d03fe7ecb..43f387bb57 100644
--- a/src/applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php
@@ -26,7 +26,7 @@ final class DifferentialDependenciesFieldSpecification
$links[] = $this->getHandle($revision_phids)->renderLink();
}
- return implode('
', $links);
+ return array_interleave(phutil_tag('br'), $links);
}
private function getDependentRevisionPHIDs() {
diff --git a/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php b/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php
index 24096ccabd..09da33abc2 100644
--- a/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php
@@ -26,7 +26,7 @@ final class DifferentialDependsOnFieldSpecification
$links[] = $this->getHandle($revision_phids)->renderLink();
}
- return implode('
', $links);
+ return phutil_safe_html(implode('
', $links));
}
private function getDependentRevisionPHIDs() {
diff --git a/src/applications/differential/field/specification/DifferentialExportPatchFieldSpecification.php b/src/applications/differential/field/specification/DifferentialExportPatchFieldSpecification.php
index 00c16b4547..313279bcb2 100644
--- a/src/applications/differential/field/specification/DifferentialExportPatchFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialExportPatchFieldSpecification.php
@@ -13,7 +13,10 @@ final class DifferentialExportPatchFieldSpecification
public function renderValueForRevisionView() {
$revision = $this->getRevision();
- return 'arc export --revision '.$revision->getID().'';
+ return phutil_tag(
+ 'tt',
+ array(),
+ 'arc export --revision '.$revision->getID());
}
}
diff --git a/src/applications/differential/field/specification/DifferentialFieldSpecification.php b/src/applications/differential/field/specification/DifferentialFieldSpecification.php
index 2f78967d7d..9453668fae 100644
--- a/src/applications/differential/field/specification/DifferentialFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialFieldSpecification.php
@@ -274,7 +274,7 @@ abstract class DifferentialFieldSpecification {
*/
public function renderUserList(array $user_phids) {
if (!$user_phids) {
- return 'None';
+ return phutil_tag('em', array(), pht('None'));
}
$links = array();
@@ -283,7 +283,7 @@ abstract class DifferentialFieldSpecification {
$links[] = $handle->renderLink();
}
- return implode(', ', $links);
+ return phutil_safe_html(implode(', ', $links));
}
diff --git a/src/applications/differential/field/specification/DifferentialHostFieldSpecification.php b/src/applications/differential/field/specification/DifferentialHostFieldSpecification.php
index 1f9ed6b700..b1f1a9c099 100644
--- a/src/applications/differential/field/specification/DifferentialHostFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialHostFieldSpecification.php
@@ -17,7 +17,7 @@ final class DifferentialHostFieldSpecification
if (!$host) {
return null;
}
- return phutil_escape_html($host);
+ return $host;
}
}
diff --git a/src/applications/differential/field/specification/DifferentialLinesFieldSpecification.php b/src/applications/differential/field/specification/DifferentialLinesFieldSpecification.php
index 01ac9ec1f7..31a7b7bac3 100644
--- a/src/applications/differential/field/specification/DifferentialLinesFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialLinesFieldSpecification.php
@@ -13,7 +13,7 @@ final class DifferentialLinesFieldSpecification
public function renderValueForRevisionView() {
$diff = $this->getDiff();
- return phutil_escape_html(number_format($diff->getLineCount()));
+ return number_format($diff->getLineCount());
}
public function shouldAppearOnRevisionList() {
diff --git a/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php b/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php
index d628897632..44890675bd 100644
--- a/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php
@@ -29,7 +29,7 @@ final class DifferentialManiphestTasksFieldSpecification
$links[] = $this->getHandle($task_phid)->renderLink();
}
- return implode('
', $links);
+ return phutil_safe_html(implode('
', $links));
}
private function getManiphestTaskPHIDs() {
diff --git a/src/applications/differential/field/specification/DifferentialPathFieldSpecification.php b/src/applications/differential/field/specification/DifferentialPathFieldSpecification.php
index 7a85823833..376d080add 100644
--- a/src/applications/differential/field/specification/DifferentialPathFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialPathFieldSpecification.php
@@ -19,7 +19,7 @@ final class DifferentialPathFieldSpecification
return null;
}
- return phutil_escape_html($path);
+ return $path;
}
}
diff --git a/src/applications/differential/field/specification/DifferentialRevertPlanFieldSpecification.php b/src/applications/differential/field/specification/DifferentialRevertPlanFieldSpecification.php
index f23b39c875..c3560c08a3 100644
--- a/src/applications/differential/field/specification/DifferentialRevertPlanFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialRevertPlanFieldSpecification.php
@@ -47,7 +47,7 @@ final class DifferentialRevertPlanFieldSpecification
if (!$this->value) {
return null;
}
- return phutil_escape_html($this->value);
+ return $this->value;
}
public function shouldAppearOnConduitView() {
diff --git a/src/applications/differential/view/DifferentialResultsTableView.php b/src/applications/differential/view/DifferentialResultsTableView.php
index 519c9319f1..f2be210728 100644
--- a/src/applications/differential/view/DifferentialResultsTableView.php
+++ b/src/applications/differential/view/DifferentialResultsTableView.php
@@ -102,13 +102,13 @@ final class DifferentialResultsTableView extends AphrontView {
require_celerity_resource('differential-results-table-css');
- return javelin_render_tag(
+ return javelin_tag(
'table',
array(
'class' => 'differential-results-table',
'sigil' => 'differential-results-table',
),
- implode("\n", $rows));
+ $rows);
}
diff --git a/src/applications/differential/view/DifferentialRevisionDetailView.php b/src/applications/differential/view/DifferentialRevisionDetailView.php
index 8e366f560c..1182012952 100644
--- a/src/applications/differential/view/DifferentialRevisionDetailView.php
+++ b/src/applications/differential/view/DifferentialRevisionDetailView.php
@@ -66,10 +66,10 @@ final class DifferentialRevisionDetailView extends AphrontView {
switch ($local_vcs) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
- $next_step = 'arc land';
+ $next_step = phutil_tag('tt', array(), 'arc land');
break;
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
- $next_step = 'arc commit';
+ $next_step = phutil_tag('tt', array(), 'arc commit');
break;
}
}
diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
index 624dbdb9ac..534ddd7e8c 100644
--- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -805,17 +805,17 @@ final class DiffusionBrowseFileController extends DiffusionController {
$size = strlen($data);
$properties->addTextContent(
pht('This is a binary file. It is %2$s byte(s) in length.',
- $size,
- PhutilTranslator::getInstance()->formatNumber($size))
- );
+ $size,
+ PhutilTranslator::getInstance()->formatNumber($size)));
$actions = id(new PhabricatorActionListView())
->setUser($this->getRequest()->getUser())
->addAction($this->createEditAction())
- ->addAction(id(new PhabricatorActionView())
- ->setName(pht('Download Binary File...'))
- ->setIcon('download')
- ->setHref($file_uri));
+ ->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Download Binary File...'))
+ ->setIcon('download')
+ ->setHref($file_uri));
return array($actions, $properties);
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
index 235be74c25..7181c0b5da 100644
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -92,11 +92,13 @@ final class DiffusionCommitController extends DiffusionController {
}
$property_list->addTextContent(
- ''
- );
+ $engine->markupText($commit_data->getCommitMessage()))));
$content[] = $top_anchor;
$content[] = $headsup_view;
@@ -412,7 +414,7 @@ final class DiffusionCommitController extends DiffusionController {
if ($data->getCommitDetail('authorPHID')) {
$props['Author'] = $handles[$author_phid]->renderLink();
} else {
- $props['Author'] = phutil_escape_html($data->getAuthorName());
+ $props['Author'] = $data->getAuthorName();
}
$reviewer_phid = $data->getCommitDetail('reviewerPHID');
@@ -426,7 +428,7 @@ final class DiffusionCommitController extends DiffusionController {
if ($data->getCommitDetail('committerPHID')) {
$props['Committer'] = $handles[$committer_phid]->renderLink();
} else {
- $props['Committer'] = phutil_escape_html($committer);
+ $props['Committer'] = $committer;
}
}
@@ -467,7 +469,7 @@ final class DiffusionCommitController extends DiffusionController {
foreach ($task_phids as $phid) {
$task_list[] = $handles[$phid]->renderLink();
}
- $task_list = implode('
', $task_list);
+ $task_list = array_interleave(phutil_tag('br'), $task_list);
$props['Tasks'] = $task_list;
}
@@ -476,7 +478,7 @@ final class DiffusionCommitController extends DiffusionController {
foreach ($proj_phids as $phid) {
$proj_list[] = $handles[$phid]->renderLink();
}
- $proj_list = implode('
', $proj_list);
+ $proj_list = array_interleave(phutil_tag('br'), $proj_list);
$props['Projects'] = $proj_list;
}
diff --git a/src/applications/drydock/controller/DrydockLeaseViewController.php b/src/applications/drydock/controller/DrydockLeaseViewController.php
index 21ab432f91..ac634b9ccc 100644
--- a/src/applications/drydock/controller/DrydockLeaseViewController.php
+++ b/src/applications/drydock/controller/DrydockLeaseViewController.php
@@ -109,19 +109,17 @@ final class DrydockLeaseViewController extends DrydockController {
$view->addProperty(
pht('Resource Type'),
- phutil_escape_html($lease->getResourceType()));
+ $lease->getResourceType());
$view->addProperty(
pht('Resource'),
- phutil_escape_html($lease->getResourceID()));
+ $lease->getResourceID());
$attributes = $lease->getAttributes();
if ($attributes) {
$view->addSectionHeader(pht('Attributes'));
foreach ($attributes as $key => $value) {
- $view->addProperty(
- phutil_escape_html($key),
- phutil_escape_html($value));
+ $view->addProperty($key, $value);
}
}
diff --git a/src/applications/drydock/controller/DrydockResourceViewController.php b/src/applications/drydock/controller/DrydockResourceViewController.php
index 47ffb98d4f..33dcf38514 100644
--- a/src/applications/drydock/controller/DrydockResourceViewController.php
+++ b/src/applications/drydock/controller/DrydockResourceViewController.php
@@ -97,7 +97,6 @@ final class DrydockResourceViewController extends DrydockController {
$status = $resource->getStatus();
$status = DrydockResourceStatus::getNameForStatus($status);
- $status = phutil_escape_html($status);
$view->addProperty(
pht('Status'),
@@ -105,15 +104,13 @@ final class DrydockResourceViewController extends DrydockController {
$view->addProperty(
pht('Resource Type'),
- phutil_escape_html($resource->getType()));
+ $resource->getType());
$attributes = $resource->getAttributes();
if ($attributes) {
$view->addSectionHeader(pht('Attributes'));
foreach ($attributes as $key => $value) {
- $view->addProperty(
- phutil_escape_html($key),
- phutil_escape_html($value));
+ $view->addProperty($key, $value);
}
}
diff --git a/src/applications/files/controller/PhabricatorFileInfoController.php b/src/applications/files/controller/PhabricatorFileInfoController.php
index 9b1f1c0619..faeac9c154 100644
--- a/src/applications/files/controller/PhabricatorFileInfoController.php
+++ b/src/applications/files/controller/PhabricatorFileInfoController.php
@@ -112,19 +112,19 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
$view->addProperty(
pht('Mime Type'),
- phutil_escape_html($file->getMimeType()));
+ $file->getMimeType());
$view->addProperty(
pht('Engine'),
- phutil_escape_html($file->getStorageEngine()));
+ $file->getStorageEngine());
$view->addProperty(
pht('Format'),
- phutil_escape_html($file->getStorageFormat()));
+ $file->getStorageFormat());
$view->addProperty(
pht('Handle'),
- phutil_escape_html($file->getStorageHandle()));
+ $file->getStorageHandle());
$metadata = $file->getMetadata();
if (!empty($metadata)) {
@@ -133,7 +133,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
foreach ($metadata as $key => $value) {
$view->addProperty(
PhabricatorFile::getMetadataName($key),
- phutil_escape_html($value));
+ $value);
}
}
diff --git a/src/applications/macro/controller/PhabricatorMacroViewController.php b/src/applications/macro/controller/PhabricatorMacroViewController.php
index b2b7d1e98a..770ae16a1c 100644
--- a/src/applications/macro/controller/PhabricatorMacroViewController.php
+++ b/src/applications/macro/controller/PhabricatorMacroViewController.php
@@ -147,9 +147,9 @@ final class PhabricatorMacroViewController
foreach ($subscribers as $subscriber) {
$sub_view[] = $this->getHandle($subscriber)->renderLink();
}
- $sub_view = implode(', ', $sub_view);
+ $sub_view = array_interleave(', ', $sub_view);
} else {
- $sub_view = ''.pht('None').'';
+ $sub_view = phutil_tag('em', array(), pht('None'));
}
$view->addProperty(
diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
index cf1059d99e..b4567f0ddf 100644
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -435,18 +435,17 @@ final class ManiphestTaskDetailController extends ManiphestController {
pht('Assigned To'),
$task->getOwnerPHID()
? $this->getHandle($task->getOwnerPHID())->renderLink()
- : ''.pht('None').'');
+ : phutil_tag('em', array(), pht('None')));
$view->addProperty(
pht('Priority'),
- phutil_escape_html(
- ManiphestTaskPriority::getTaskPriorityName($task->getPriority())));
+ ManiphestTaskPriority::getTaskPriorityName($task->getPriority()));
$view->addProperty(
pht('Subscribers'),
$task->getCCPHIDs()
? $this->renderHandlesForPHIDs($task->getCCPHIDs(), ',')
- : ''.pht('None').'');
+ : phutil_tag('em', array(), pht('None')));
$view->addProperty(
pht('Author'),
@@ -469,7 +468,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
pht('Projects'),
$task->getProjectPHIDs()
? $this->renderHandlesForPHIDs($task->getProjectPHIDs(), ',')
- : ''.pht('None').'');
+ : phutil_tag('em', array(), pht('None')));
foreach ($aux_fields as $aux_field) {
$aux_key = $aux_field->getAuxiliaryKey();
diff --git a/src/applications/phame/controller/blog/PhameBlogViewController.php b/src/applications/phame/controller/blog/PhameBlogViewController.php
index 15fc82ad2a..00214cf100 100644
--- a/src/applications/phame/controller/blog/PhameBlogViewController.php
+++ b/src/applications/phame/controller/blog/PhameBlogViewController.php
@@ -69,11 +69,11 @@ final class PhameBlogViewController extends PhameController {
$properties->addProperty(
pht('Skin'),
- phutil_escape_html($blog->getSkin()));
+ $blog->getSkin());
$properties->addProperty(
pht('Domain'),
- phutil_escape_html($blog->getDomain()));
+ $blog->getDomain());
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
$user,
@@ -97,9 +97,12 @@ final class PhameBlogViewController extends PhameController {
->process();
$properties->addTextContent(
- '
'.
- 'haiku. it is very bad.
'.
- 'what did you expect?');
+ phutil_safe_html(
+ 'this is a pasta
'.
+ 'haiku. it is very bad.
'.
+ 'what did you expect?'));
$edge_cases_header = id(new PhabricatorHeaderView())
->setHeader(pht('Edge Cases'));
diff --git a/src/view/layout/PhabricatorPropertyListView.php b/src/view/layout/PhabricatorPropertyListView.php
index d89ee97fb4..85c1c2774b 100644
--- a/src/view/layout/PhabricatorPropertyListView.php
+++ b/src/view/layout/PhabricatorPropertyListView.php
@@ -93,30 +93,21 @@ final class PhabricatorPropertyListView extends AphrontView {
'class' => 'phabricator-property-list-key',
),
$key);
- $items[] = phutil_render_tag(
+
+ $items[] = phutil_tag(
'dd',
array(
'class' => 'phabricator-property-list-value',
),
- $this->renderSingleView($value));
+ $this->renderHTMLView($value));
}
- $list = phutil_render_tag(
+ $list = phutil_tag(
'dl',
array(
'class' => 'phabricator-property-list-properties',
),
- $this->renderSingleView($items));
-
- $content = $this->renderChildren();
- if (strlen($content)) {
- $content = phutil_render_tag(
- 'div',
- array(
- 'class' => 'phabricator-property-list-content',
- ),
- $content);
- }
+ $this->renderHTMLView($items));
$shortcuts = null;
if ($this->hasKeyboardShortcuts) {
@@ -124,9 +115,9 @@ final class PhabricatorPropertyListView extends AphrontView {
id(new AphrontKeyboardShortcutsAvailableView())->render();
}
- return
- $shortcuts.
- phutil_render_tag(
+ return array(
+ $shortcuts,
+ phutil_tag(
'div',
array(
'class' => 'phabricator-property-list-container',
@@ -137,7 +128,7 @@ final class PhabricatorPropertyListView extends AphrontView {
'div',
array('class' => 'phabriator-property-list-view-end'),
''),
- ));
+ )));
}
private function renderSectionPart(array $part) {
@@ -150,7 +141,7 @@ final class PhabricatorPropertyListView extends AphrontView {
}
private function renderTextPart(array $part) {
- return phutil_render_tag(
+ return phutil_tag(
'div',
array(
'class' => 'phabricator-property-list-text-content',
--
2.51.2
From fb59101cde0301950dcd66865daa6b2d4b33c632 Mon Sep 17 00:00:00 2001
From: epriestley ';
- $table[] = ' ';
+ $dict[$key] = PhabricatorEnv::getUnrepairedEnvConfig($key);
}
-
- $table = phutil_tag(
- 'table',
- array(
- ),
- new PhutilSafeHTML(implode("\n", $table)));
+ $table = $this->renderValueTable($dict);
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
@@ -164,12 +151,11 @@ final class PhabricatorSetupIssueView extends AphrontView {
$update = array();
foreach ($configs as $key) {
- $cmd = 'phabricator/ $ ./bin/config set '.
- phutil_escape_html($key).' '.
- 'value';
- $update[] = $cmd;
+ $update[] = hsprintf(
+ 'phabricator/ $ ./bin/config set %s value',
+ $key);
}
- $update = phutil_render_tag('pre', array(), implode("\n", $update));
+ $update = phutil_tag('pre', array(), array_interleave("\n", $update));
} else {
$update = array();
foreach ($configs as $config) {
@@ -182,11 +168,11 @@ final class PhabricatorSetupIssueView extends AphrontView {
'href' => '/config/edit/'.$config.'/?issue='.$issue->getIssueKey(),
),
pht('Edit %s', $config));
- $update[] = ''.phutil_escape_html($key).' ';
-
- $value = PhabricatorEnv::getUnrepairedEnvConfig($key);
- if ($value === null) {
- $value = 'null';
- } else if ($value === false) {
- $value = 'false';
- } else if ($value === true) {
- $value = 'true';
- } else {
- $value = phutil_escape_html(
- PhabricatorConfigJSON::prettyPrintJSON($value));
- }
-
- $table[] = ''.$value.' ';
- $table[] = ''.implode("\n", $update).'
';
- $update_info = phutil_render_tag(
+ $update = phutil_tag('ul', array(), $update);
+ $update_info = phutil_tag(
'p',
array(),
pht("You can update these %d value(s) here:", count($configs)));
@@ -196,12 +182,12 @@ final class PhabricatorSetupIssueView extends AphrontView {
}
}
- return phutil_render_tag(
+ return phutil_tag(
'div',
array(
'class' => 'setup-issue-config',
),
- self::renderSingleView(
+ self::renderHTMLView(
array(
$table_info,
$table,
@@ -218,32 +204,12 @@ final class PhabricatorSetupIssueView extends AphrontView {
"The current PHP configuration has these %d value(s):",
count($configs)));
- $table = array();
+ $dict = array();
foreach ($configs as $key) {
- $table[] = '';
- $table[] = ' ';
+ $dict[$key] = ini_get($key);
}
- $table = phutil_tag(
- 'table',
- array(),
- new PhutilSafeHTML(implode("\n", $table)));
+ $table = $this->renderValueTable($dict);
ob_start();
phpinfo();
@@ -270,41 +236,42 @@ final class PhabricatorSetupIssueView extends AphrontView {
}
}
+ $info = array();
if (!$ini_loc) {
- $info = phutil_tag(
+ $info[] = phutil_tag(
'p',
array(),
pht(
"To update these %d value(s), edit your PHP configuration file.",
count($configs)));
} else {
- $info = phutil_tag(
+ $info[] = phutil_tag(
'p',
array(),
pht(
"To update these %d value(s), edit your PHP configuration file, ".
"located here:",
count($configs)));
- $info .= phutil_tag(
+ $info[] = phutil_tag(
'pre',
array(),
$ini_loc);
}
if ($more_loc) {
- $info .= phutil_tag(
+ $info[] = phutil_tag(
'p',
array(),
pht(
"PHP also loaded these configuration file(s):",
count($more_loc)));
- $info .= phutil_tag(
+ $info[] = phutil_tag(
'pre',
array(),
implode("\n", $more_loc));
}
- $info .= phutil_tag(
+ $info[] = phutil_tag(
'p',
array(),
phutil_safe_html(pht(
@@ -312,7 +279,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
'PHP Documentation.',
'http://php.net/manual/ini.list.php')));
- $info .= phutil_tag(
+ $info[] = phutil_tag(
'p',
array(),
phutil_safe_html(pht(
@@ -324,7 +291,38 @@ final class PhabricatorSetupIssueView extends AphrontView {
array(
'class' => 'setup-issue-config',
),
- array($table_info, $table, $info));
+ $this->renderHTMLView(
+ array(
+ $table_info,
+ $table,
+ $info,
+ )));
+ }
+
+ private function renderValueTable(array $dict) {
+ $rows = array();
+ foreach ($dict as $key => $value) {
+ $cols = array(
+ phutil_tag('th', array(), $key),
+ phutil_tag('td', array(), $this->renderValueForDisplay($value)),
+ );
+ $rows[] = phutil_tag('tr', array(), $cols);
+ }
+ return phutil_tag('table', array(), $rows);
+ }
+
+ private function renderValueForDisplay($value) {
+ if ($value === null) {
+ return phutil_tag('em', array(), 'null');
+ } else if ($value === false) {
+ return phutil_tag('em', array(), 'false');
+ } else if ($value === true) {
+ return phutil_tag('em', array(), 'true');
+ } else if ($value === '') {
+ return phutil_tag('em', array(), 'empty string');
+ } else {
+ return PhabricatorConfigJSON::prettyPrintJSON($value);
+ }
}
}
diff --git a/src/applications/uiexample/examples/PhabricatorSetupIssueExample.php b/src/applications/uiexample/examples/PhabricatorSetupIssueExample.php
new file mode 100644
index 0000000000..1f25ef3e0a
--- /dev/null
+++ b/src/applications/uiexample/examples/PhabricatorSetupIssueExample.php
@@ -0,0 +1,38 @@
+getRequest();
+ $user = $request->getUser();
+
+ $issue = id(new PhabricatorSetupIssue())
+ ->setShortName(pht('Short Name'))
+ ->setName(pht('Name'))
+ ->setSummary(pht('Summary'))
+ ->setMessage(pht('Message'))
+ ->setIssueKey('example.key')
+ ->addCommand('$ # Add Command')
+ ->addCommand(hsprintf('$ %s', '$ ls -1 > /dev/null'))
+ ->addPHPConfig('php.config.example')
+ ->addPhabricatorConfig('test.value')
+ ->addPHPExtension('libexample');
+
+ // NOTE: Since setup issues may be rendered before we can build the page
+ // chrome, they don't explicitly include resources.
+ require_celerity_resource('setup-issue-css');
+
+ $view = id(new PhabricatorSetupIssueView())
+ ->setIssue($issue);
+
+ return $view;
+ }
+}
--
2.51.2
From 0a9f378594f07df699f6fb6f6ea8c9ef6b9d8300 Mon Sep 17 00:00:00 2001
From: epriestley '.phutil_escape_html($key).' ';
-
- $value = ini_get($key);
- if ($value === null) {
- $value = 'null';
- } else if ($value === false) {
- $value = 'false';
- } else if ($value === true) {
- $value = 'true';
- } else if ($value === '') {
- $value = '(empty string)';
- } else {
- $value = phutil_escape_html($value);
- }
-
- $table[] = ''.$value.' ';
- $table[] = ''.
- phutil_escape_html($message).
- $more.
- ' '));
+ phutil_tag(
+ 'td',
+ array(
+ 'class' => 'differential-shield',
+ 'colspan' => 6,
+ ),
+ $content)));
}
protected function wrapChangeInTable($content) {
@@ -350,7 +355,10 @@ abstract class DifferentialChangesetHTMLRenderer
return null;
}
- return javelin_render_tag(
+ // TODO: [HTML] After TwoUpRenderer gets refactored, fix this.
+ $content = phutil_safe_html($content);
+
+ return javelin_tag(
'table',
array(
'class' => 'differential-diff remarkup-code PhabricatorMonospaced',
diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
index cb22b44341..7a9bb3a1af 100644
--- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
+++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
@@ -148,16 +148,36 @@ final class DifferentialChangesetTwoUpRenderer
}
}
- $container = javelin_render_tag(
+ $container = javelin_tag(
'tr',
array(
'sigil' => 'context-target',
),
- ''.
- implode(' • ', $contents).
- ' '.
- ''.$context_line.''.
- ' '.$context.' ');
+ array(
+ phutil_tag(
+ 'td',
+ array(
+ 'colspan' => 2,
+ 'class' => 'show-more',
+ ),
+ array_interleave(
+ " \xE2\x80\xA2 ", // Bullet
+ $contents)),
+ phutil_tag(
+ 'th',
+ array(
+ 'class' => 'show-context-line',
+ ),
+ $context_line ? (int)$context_line : null),
+ phutil_tag(
+ 'td',
+ array(
+ 'colspan' => 3,
+ 'class' => 'show-context',
+ ),
+ // TODO: [HTML] Escaping model here isn't ideal.
+ phutil_safe_html($context)),
+ ));
$html[] = $container;
diff --git a/src/applications/differential/view/DifferentialChangesetDetailView.php b/src/applications/differential/view/DifferentialChangesetDetailView.php
index 364fe35701..f77b5377d3 100644
--- a/src/applications/differential/view/DifferentialChangesetDetailView.php
+++ b/src/applications/differential/view/DifferentialChangesetDetailView.php
@@ -59,10 +59,12 @@ final class DifferentialChangesetDetailView extends AphrontView {
$buttons = null;
if ($this->buttons) {
- $buttons =
- '';
+ $buttons = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'differential-changeset-buttons',
+ ),
+ $this->buttons);
}
$id = $this->getID();
@@ -77,7 +79,7 @@ final class DifferentialChangesetDetailView extends AphrontView {
$display_filename = $changeset->getDisplayFilename();
- $output = javelin_render_tag(
+ return javelin_tag(
'div',
array(
'sigil' => 'differential-changeset',
@@ -90,17 +92,17 @@ final class DifferentialChangesetDetailView extends AphrontView {
'class' => $class,
'id' => $id,
),
- id(new PhabricatorAnchorView())
- ->setAnchorName($changeset->getAnchorName())
- ->setNavigationMarker(true)
- ->render().
- $buttons.
- ''.phutil_escape_html($display_filename).'
'.
- ''.
- $this->renderChildren());
-
-
- return $output;
+ $this->renderHTMLView(
+ array(
+ id(new PhabricatorAnchorView())
+ ->setAnchorName($changeset->getAnchorName())
+ ->setNavigationMarker(true)
+ ->render(),
+ $buttons,
+ phutil_tag('h1', array(), $display_filename),
+ phutil_tag('div', array('style' => 'clear: both'), ''),
+ $this->renderHTMLChildren(),
+ )));
}
}
diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php
index abbca39906..00094164f4 100644
--- a/src/applications/differential/view/DifferentialChangesetListView.php
+++ b/src/applications/differential/view/DifferentialChangesetListView.php
@@ -192,17 +192,19 @@ final class DifferentialChangesetListView extends AphrontView {
));
}
- return
- id(new PhabricatorHeaderView())
- ->setHeader($this->getTitle())
- ->render().
- phutil_render_tag(
- 'div',
+ return $this->renderHTMLView(
array(
- 'class' => 'differential-review-stage',
- 'id' => 'differential-review-stage',
- ),
- implode("\n", $output));
+ id(new PhabricatorHeaderView())
+ ->setHeader($this->getTitle())
+ ->render(),
+ phutil_tag(
+ 'div',
+ array(
+ 'class' => 'differential-review-stage',
+ 'id' => 'differential-review-stage',
+ ),
+ $output),
+ ));
}
/**
diff --git a/webroot/rsrc/js/application/core/behavior-dark-console.js b/webroot/rsrc/js/application/core/behavior-dark-console.js
index 0c72d0469c..99370a9342 100644
--- a/webroot/rsrc/js/application/core/behavior-dark-console.js
+++ b/webroot/rsrc/js/application/core/behavior-dark-console.js
@@ -81,7 +81,6 @@ JX.behavior('dark-console', function(config, statics) {
JX.DOM.alterClass(req.all[req.current], 'dark-selected', true);
if (statics.visible) {
- JX.log('visible!');
draw_request(key);
}
}
--
2.51.2
From 74a90999d86c3a95e601c6bf5e30c47e84c1f395 Mon Sep 17 00:00:00 2001
From: epriestley '.
- ' '.
- ' '.
- ' '.$content.' ';
- } else {
- $core =
- ''.
- ' '.$content.' '.
- ''.
- ' ';
- }
-
- return '
';
+ $this->renderHTMLView(
+ array(
+ $this->renderInputs(),
+ $this->renderBody(),
+ )));
+
+ return hsprintf(
+ ''.$core.' '.
+ '
',
+ $this->onRight ? null : $content,
+ $this->onRight ? $content : null);
}
private function renderInputs() {
@@ -87,13 +86,13 @@ final class DifferentialInlineCommentEditView extends AphrontView {
'value' => $value,
));
}
- return implode('', $out);
+ return $out;
}
private function renderBody() {
$buttons = array();
- $buttons[] = '';
+ $buttons[] = phutil_tag('button', array(), 'Ready');
$buttons[] = javelin_tag(
'button',
array(
@@ -102,8 +101,6 @@ final class DifferentialInlineCommentEditView extends AphrontView {
),
pht('Cancel'));
- $buttons = implode('', $buttons);
-
$formatting = phutil_tag(
'a',
array(
@@ -114,7 +111,33 @@ final class DifferentialInlineCommentEditView extends AphrontView {
),
pht('Formatting Reference'));
- return javelin_render_tag(
+ $title = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'differential-inline-comment-edit-title',
+ ),
+ $this->title);
+
+ $body = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'differential-inline-comment-edit-body',
+ ),
+ $this->renderHTMLChildren());
+
+ $edit = phutil_tag(
+ 'edit',
+ array(
+ 'class' => 'differential-inline-comment-edit-buttons',
+ ),
+ $this->renderHTMLView(
+ array(
+ $formatting,
+ $buttons,
+ phutil_tag('div', array('style' => 'clear: both'), ''),
+ )));
+
+ return javelin_tag(
'div',
array(
'class' => 'differential-inline-comment-edit',
@@ -125,17 +148,12 @@ final class DifferentialInlineCommentEditView extends AphrontView {
'length' => $this->length,
),
),
- ''.
+ ' '.
+ ''.
+ ' %s '.
+ ''.
+ ' %s '.
+ ''.
- javelin_tag(
- 'input',
- array(
- 'type' => 'checkbox',
- 'name' => 'batch[]',
- 'value' => $task->getID(),
- 'sigil' => 'maniphest-batch',
- )).
- ' ';
+ $batch = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'maniphest-task-batch',
+ ),
+ javelin_tag(
+ 'input',
+ array(
+ 'type' => 'checkbox',
+ 'name' => 'batch[]',
+ 'value' => $task->getID(),
+ 'sigil' => 'maniphest-batch',
+ )));
}
$projects_view = new ManiphestTaskProjectsView();
@@ -94,7 +96,70 @@ final class ManiphestTaskSummaryView extends ManiphestView {
),
'');
- return javelin_render_tag(
+ $task_id = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'maniphest-task-number',
+ ),
+ 'T'.$task->getID());
+
+ $task_status = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'maniphest-task-status',
+ ),
+ idx($status_map, $task->getStatus(), 'Unknown'));
+
+ $task_owner = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'maniphest-task-owner',
+ ),
+ $task->getOwnerPHID()
+ ? $handles[$task->getOwnerPHID()]->renderLink()
+ : phutil_tag('em', array(), pht('None')));
+
+ $task_name = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'maniphest-task-name',
+ ),
+ phutil_tag(
+ 'a',
+ array(
+ 'href' => '/T'.$task->getID(),
+ ),
+ $task->getTitle()));
+
+ $task_projects = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'maniphest-task-projects',
+ ),
+ $projects_view->render());
+
+ $task_updated = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'maniphest-task-updated',
+ ),
+ phabricator_date($task->getDateModified(), $this->user));
+
+ $row = phutil_tag(
+ 'tr',
+ array(),
+ array(
+ $handle,
+ $batch,
+ $task_id,
+ $task_status,
+ $task_owner,
+ $task_name,
+ $task_projects,
+ $task_updated,
+ ));
+
+ return javelin_tag(
'table',
array(
'class' => 'maniphest-task-summary',
@@ -103,35 +168,7 @@ final class ManiphestTaskSummaryView extends ManiphestView {
'taskID' => $task->getID(),
),
),
- ''.
- $handle.
- $batch.
- ' ');
+ $row);
}
}
--
2.51.2
From f705c978b5d732e6523ef1b370af65ab85783c07 Mon Sep 17 00:00:00 2001
From: epriestley '.
- 'T'.$task->getID().
- ' '.
- ''.
- idx($status_map, $task->getStatus(), 'Unknown').
- ' '.
- ''.
- ($task->getOwnerPHID()
- ? $handles[$task->getOwnerPHID()]->renderLink()
- : 'None').
- ' '.
- ''.
- phutil_tag(
- 'a',
- array(
- 'href' => '/T'.$task->getID(),
- ),
- $task->getTitle()).
- ' '.
- ''.
- $projects_view->render().
- ' '.
- ''.
- phabricator_date($task->getDateModified(), $this->user).
- ' '.
- ''.
- phutil_tag(
- 'a',
- array(
- 'href' => '/'.$this->objectName,
- 'class' => 'aphront-headsup-object-name',
- ),
- $this->objectName).
- ' '.
- phutil_escape_html($this->header).
- '
';
-
- require_celerity_resource('aphront-headsup-view-css');
-
- $prop_table = null;
- if ($this->properties) {
- $prop_table = array();
- foreach ($this->properties as $key => $value) {
- $prop_table[] =
- ''.
- ' ';
- }
- $prop_table =
- ''.phutil_escape_html($key.':').' '.
- ''.$value.' '.
- ''.
- implode("\n", $prop_table).
- '
';
- }
-
- $children = $this->renderChildren();
- if (strlen($children)) {
- $children =
- ''.
- phutil_render_tag(
+ phutil_tag(
'td',
array(
'class' => 'differential-toc-char',
diff --git a/src/applications/differential/view/DifferentialLocalCommitsView.php b/src/applications/differential/view/DifferentialLocalCommitsView.php
index f3f6eab6de..6a3cae9439 100644
--- a/src/applications/differential/view/DifferentialLocalCommitsView.php
+++ b/src/applications/differential/view/DifferentialLocalCommitsView.php
@@ -88,13 +88,13 @@ final class DifferentialLocalCommitsView extends AphrontView {
$summary = phutil_utf8_shorten($summary, 80);
$view = new AphrontMoreView();
- $view->setSome(phutil_escape_html($summary));
+ $view->setSome($summary);
if ($message && (trim($summary) != trim($message))) {
- $view->setMore(nl2br(phutil_escape_html($message)));
+ $view->setMore(phutil_escape_html_newlines($message));
}
- $row[] = phutil_render_tag(
+ $row[] = phutil_tag(
'td',
array(
'class' => 'summary',
diff --git a/src/applications/differential/view/DifferentialRevisionCommentListView.php b/src/applications/differential/view/DifferentialRevisionCommentListView.php
index 8edeaeea81..ebccc8c78a 100644
--- a/src/applications/differential/view/DifferentialRevisionCommentListView.php
+++ b/src/applications/differential/view/DifferentialRevisionCommentListView.php
@@ -159,22 +159,29 @@ final class DifferentialRevisionCommentListView extends AphrontView {
array(
'markup' => implode("\n", $hidden),
));
- $hidden = javelin_render_tag(
+ $hidden = javelin_tag(
'div',
array(
'sigil' => "differential-all-comments-container",
),
- ' ',
+ $comment_html,
+ $new);
}
}
if ($n_num && isset($new_comments[$n_num])) {
foreach ($new_comments[$n_num] as $comment) {
$comment_html = $this->renderInlineComment($comment,
$on_right = true);
- $html[] =
+ $html[] = hsprintf(
'
`.
+
+If you need to extract the content of a @{class@libphutil:PhutilSafeHTML}
+object, you should call `getHTMLContent()`, not cast it to a string. Eventually,
+we would like to remove the string cast entirely.
+
+= Deprecated Functions =
+
+The functions @{function@libphutil:phutil_render_tag} and
+@{function:javelin_render_tag} are unsafe versions of
+@{function@libphutil:phutil_tag} and @{function:javelin_tag}, are deprecated,
+and will be removed in the future. You should avoid their use and convert code
+to use @{function@libphutil:phutil_tag} and @{function:javelin_tag}.
+
+The function @{function:phabricator_render_form} is also deprecated, in favor of
+@{function:phabricator_form}.
--
2.51.2
From 6e959011611a08ca5968b272cd2a5d365d1a3835 Mon Sep 17 00:00:00 2001
From: vrana '.
' ';
+ ''.
- ' '.$comment_html.' '.
+ '%s '.
''.
- ' '.$new.' '.
- '%s '.
+ ''.
' ';
+ ''.
' '.
' '.
- ' '.$comment_html.' '.
- '%s '.
+ ''.
'
';
+ '',
+ $left_markup,
+ $right_markup);
}
}
diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
index b690c484ea..f89e6ef7c6 100644
--- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -264,16 +264,13 @@ final class DiffusionBrowseFileController extends DiffusionController {
));
}
- $corpus_table = javelin_render_tag(
+ $corpus_table = javelin_tag(
'table',
array(
'class' => "diffusion-source remarkup-code PhabricatorMonospaced",
'sigil' => 'diffusion-source',
),
- implode("\n", $rows));
-
- // TODO: [HTML] Major cheating here.
- $corpus_table = phutil_safe_html($corpus_table);
+ $rows);
$corpus = phutil_tag(
'div',
@@ -774,11 +771,9 @@ final class DiffusionBrowseFileController extends DiffusionController {
->setMarkupEngine($engine)
->setInlineComment($inline)
->render();
- $rows[] =
- ''.
' '.
- ''.
- ' '.$left_markup.' '.
+ '%s '.
''.
- ' '.$right_markup.' '.
+ '%s '.
''.
- str_repeat(' ';
+ $row = array_fill(0, ($needs_blame ? 5 : 1), phutil_tag('th'));
+ $row[] = phutil_tag('td', array(), $inline_view);
+ $rows[] = phutil_tag('tr', array('class' => 'inline'), $row);
}
return $rows;
}
--
2.51.2
From 41e0f97c197a51db427b1cd77208f4700ab902a8 Mon Sep 17 00:00:00 2001
From: epriestley ', ($needs_blame ? 5 : 1)).
- ' '.$inline_view.' '.
- ''.$value.'
';
+ $value = hsprintf('%s
', $value);
return $value;
}
diff --git a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
index 3d0f2c41a0..5020173b88 100644
--- a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
@@ -58,11 +58,10 @@ final class PhabricatorConduitConsoleController
if ($error_types) {
$error_description[] = '';
foreach ($error_types as $error => $meaning) {
- $error_description[] =
- '
';
$error_description = implode("\n", $error_description);
diff --git a/src/applications/conduit/controller/PhabricatorConduitTokenController.php b/src/applications/conduit/controller/PhabricatorConduitTokenController.php
index 54273ad477..50f87cbd6d 100644
--- a/src/applications/conduit/controller/PhabricatorConduitTokenController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitTokenController.php
@@ -32,14 +32,15 @@ final class PhabricatorConduitTokenController
$panel->setHeader('Certificate Install Token');
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
- $panel->appendChild(
+ $panel->appendChild(hsprintf(
'
'.
- '(Default: '.$font_default.')')
+ '(Default: %s)',
+ $font_default))
->setValue($preferences->getPreference($pref_monospaced)))
->appendChild(
id(new AphrontFormMarkupControl())
diff --git a/src/view/form/control/AphrontFormControl.php b/src/view/form/control/AphrontFormControl.php
index 69786d2902..6bbdfe853e 100644
--- a/src/view/form/control/AphrontFormControl.php
+++ b/src/view/form/control/AphrontFormControl.php
@@ -140,10 +140,10 @@ abstract class AphrontFormControl extends AphrontView {
}
if (strlen($this->getCaption())) {
- $caption =
- '';
+ $error_description = array();
foreach ($error_types as $error => $meaning) {
$error_description[] = hsprintf(
'
';
- $error_description = implode("\n", $error_description);
+ $error_description = phutil_tag('ul', array(), $error_description);
} else {
$error_description = "This method does not raise any specific errors.";
}
diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php
index 5983bbc1ae..57ee007a08 100644
--- a/src/applications/config/controller/PhabricatorConfigEditController.php
+++ b/src/applications/config/controller/PhabricatorConfigEditController.php
@@ -137,7 +137,7 @@ final class PhabricatorConfigEditController
array(
'class' => 'phabricator-remarkup',
),
- phutil_safe_html($engine->getOutput($option, 'description')));
+ $engine->getOutput($option, 'description'));
$form
->setUser($user)
@@ -419,23 +419,23 @@ final class PhabricatorConfigEditController
}
$table = array();
- $table[] = '';
- $table[] = ' ';
+ $table[] = hsprintf(
+ ''.pht('Example').' ';
- $table[] = ''.pht('Value').' ';
- $table[] = ' ',
+ pht('Example'),
+ pht('Value'));
foreach ($examples as $example) {
list($value, $description) = $example;
if ($value === null) {
- $value = ''.pht('(empty)').'';
+ $value = phutil_tag('em', array(), pht('(empty)'));
} else {
- $value = nl2br(phutil_escape_html($value));
+ $value = phutil_escape_html_newlines($value);
}
- $table[] = '%s %s ';
- $table[] = ' ';
+ $table[] = hsprintf(
+ ''.phutil_escape_html($description).' ';
- $table[] = ''.$value.' ';
- $table[] = ' ',
+ $description,
+ $value);
}
require_celerity_resource('config-options-css');
@@ -445,7 +445,7 @@ final class PhabricatorConfigEditController
array(
'class' => 'config-option-table',
),
- new PhutilSafeHTML(implode("\n", $table)));
+ $table);
}
private function renderDefaults(PhabricatorConfigOption $option) {
@@ -467,10 +467,10 @@ final class PhabricatorConfigEditController
$table = array();
- $table[] = '%s %s ';
- $table[] = ' ';
+ $table[] = hsprintf(
+ ''.pht('Source').' ';
- $table[] = ''.pht('Value').' ';
- $table[] = ' ',
+ pht('Source'),
+ pht('Value'));
foreach ($stack as $key => $source) {
$value = $source->getKeys(
array(
@@ -478,16 +478,16 @@ final class PhabricatorConfigEditController
));
if (!array_key_exists($option->getKey(), $value)) {
- $value = ''.pht('(empty)').'';
+ $value = phutil_tag('em', array(), pht('(empty)'));
} else {
$value = PhabricatorConfigJSON::prettyPrintJSON(
$value[$option->getKey()]);
}
- $table[] = '%s %s ';
- $table[] = ' ';
+ $table[] = hsprintf(
+ ''.phutil_escape_html($source->getName()).' ';
- $table[] = ''.$value.' ';
- $table[] = ' ',
+ $source->getName(),
+ $value);
}
require_celerity_resource('config-options-css');
@@ -497,7 +497,7 @@ final class PhabricatorConfigEditController
array(
'class' => 'config-option-table',
),
- new PhutilSafeHTML(implode("\n", $table)));
+ $table);
}
}
diff --git a/src/applications/differential/controller/DifferentialDiffViewController.php b/src/applications/differential/controller/DifferentialDiffViewController.php
index d764f560e3..afe4847c8c 100644
--- a/src/applications/differential/controller/DifferentialDiffViewController.php
+++ b/src/applications/differential/controller/DifferentialDiffViewController.php
@@ -38,11 +38,11 @@ final class DifferentialDiffViewController extends DifferentialController {
// TODO: implmenent optgroup support in AphrontFormSelectControl?
$select = array();
- $select[] = '';
+ $select[] = hsprintf('');
$revision_data = new DifferentialRevisionListData(
DifferentialRevisionListData::QUERY_OPEN_OWNED,
@@ -50,7 +50,9 @@ final class DifferentialDiffViewController extends DifferentialController {
$revisions = $revision_data->loadRevisions();
if ($revisions) {
- $select[] = '');
}
- $select =
- '';
+ $select = phutil_tag(
+ 'select',
+ array('name' => 'revisionID'),
+ $select);
$action_form = new AphrontFormView();
$action_form
diff --git a/src/applications/files/controller/PhabricatorFileUploadController.php b/src/applications/files/controller/PhabricatorFileUploadController.php
index 94a1130ca5..cab1f145f6 100644
--- a/src/applications/files/controller/PhabricatorFileUploadController.php
+++ b/src/applications/files/controller/PhabricatorFileUploadController.php
@@ -30,13 +30,12 @@ final class PhabricatorFileUploadController extends PhabricatorFileController {
$instructions = id(new AphrontFormMarkupControl())
->setControlID($support_id)
->setControlStyle('display: none')
- ->setValue(
- '%s %s
'.
+ ->setValue(hsprintf(
+ '
%s %s
',
+ pht('Drag and Drop:'),
pht(
- 'Drag and Drop: You can also upload files by '.
- 'dragging and dropping them from your desktop onto this page or '.
- 'the Phabricator home page.').
- '
');
+ 'You can also upload files by dragging and dropping them from your '.
+ 'desktop onto this page or the Phabricator home page.')));
$form = id(new AphrontFormView())
->setFlexible(true)
diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php
index f61062520d..b5fee57e90 100644
--- a/src/applications/herald/controller/HeraldRuleController.php
+++ b/src/applications/herald/controller/HeraldRuleController.php
@@ -117,9 +117,10 @@ final class HeraldRuleController extends HeraldController {
$form
->appendChild(
id(new AphrontFormMarkupControl())
- ->setValue(
- "This ${rule_type_name} rule triggers for " .
- "${content_type_name}."))
+ ->setValue(hsprintf(
+ "This %s rule triggers for %s.",
+ $rule_type_name,
+ $content_type_name)))
->appendChild(
id(new AphrontFormInsetView())
->setTitle('Conditions')
@@ -154,9 +155,9 @@ final class HeraldRuleController extends HeraldController {
'mustcapture' => true,
),
'Create New Action'))
- ->setDescription(
- phutil_safe_html(
- 'Take these actions '.$repetition_selector.' this rule matches:'))
+ ->setDescription(hsprintf(
+ 'Take these actions %s this rule matches:',
+ $repetition_selector))
->setContent(javelin_tag(
'table',
array(
diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php
index 5b258baf8f..23fcf30bee 100644
--- a/src/applications/maniphest/controller/ManiphestTaskEditController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php
@@ -455,11 +455,8 @@ final class ManiphestTaskEditController extends ManiphestController {
));
if ($files) {
- $file_display = array();
- foreach ($files as $file) {
- $file_display[] = phutil_escape_html($file->getName());
- }
- $file_display = implode('
', $file_display);
+ $file_display = mpull($files, 'getName');
+ $file_display = array_interleave(phutil_tag('br'), $file_display);
$form->appendChild(
id(new AphrontFormMarkupControl())
diff --git a/src/applications/paste/controller/PhabricatorPasteEditController.php b/src/applications/paste/controller/PhabricatorPasteEditController.php
index 63beb71670..29d0272209 100644
--- a/src/applications/paste/controller/PhabricatorPasteEditController.php
+++ b/src/applications/paste/controller/PhabricatorPasteEditController.php
@@ -164,10 +164,9 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
->appendChild(
id(new AphrontFormMarkupControl())
->setLabel('Text')
- ->setValue(
- 'Paste text can not be edited. '.
- $fork_link.' to create a new paste.'
- ));
+ ->setValue(hsprintf(
+ 'Paste text can not be edited. %s to create a new paste.',
+ $fork_link)));
}
$submit = new AphrontFormSubmitControl();
diff --git a/src/applications/phortune/control/PhortuneMonthYearExpiryControl.php b/src/applications/phortune/control/PhortuneMonthYearExpiryControl.php
index a4701aa11c..b9c48cd595 100644
--- a/src/applications/phortune/control/PhortuneMonthYearExpiryControl.php
+++ b/src/applications/phortune/control/PhortuneMonthYearExpiryControl.php
@@ -80,12 +80,7 @@ final class PhortuneMonthYearExpiryControl extends AphrontFormControl {
'sigil' => 'year-input',
));
- return self::renderSingleView(
- array(
- $months_sel,
- $years_sel
- )
- );
+ return hsprintf('%s%s', $months_sel, $years_sel);
}
}
diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php
index 97b1a21c4b..b5b4d00d35 100644
--- a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php
+++ b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php
@@ -122,10 +122,10 @@ EXAMPLE;
->setValue($preferences->getPreference($pref_monospaced)))
->appendChild(
id(new AphrontFormMarkupControl())
- ->setValue(
- ''.
- phutil_escape_html($example_string).
- '
'))
+ ->setValue(phutil_tag(
+ 'pre',
+ array('class' => 'PhabricatorMonospaced'),
+ $example_string)))
->appendChild(
id(new AphrontFormRadioButtonControl())
->setLabel('Monospaced Textareas')
diff --git a/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php b/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
index 2bc75bc744..9440e476b4 100644
--- a/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
+++ b/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
@@ -112,7 +112,6 @@ final class PhabricatorSlowvotePollController
$viewer_choices,
$option);
}
- $option_markup = implode("\n", $option_markup);
$comments_by_option = array();
switch ($poll->getMethod()) {
diff --git a/src/view/form/control/AphrontFormCheckboxControl.php b/src/view/form/control/AphrontFormCheckboxControl.php
index 00a85f52a9..4d452c448e 100644
--- a/src/view/form/control/AphrontFormCheckboxControl.php
+++ b/src/view/form/control/AphrontFormCheckboxControl.php
@@ -38,16 +38,15 @@ final class AphrontFormCheckboxControl extends AphrontFormControl {
'for' => $id,
),
$box['label']);
- $rows[] =
- ''.
- ' ';
+ $rows[] = hsprintf(
+ ''.$checkbox.' '.
- ''.$label.' '.
- ' ',
+ $checkbox,
+ $label);
}
- return
- '%s %s '.
- implode("\n", $rows).
- '
';
+ return phutil_tag(
+ 'table',
+ array('class' => 'aphront-form-control-checkbox-layout'),
+ $rows);
}
}
diff --git a/src/view/form/control/AphrontFormControl.php b/src/view/form/control/AphrontFormControl.php
index 6bbdfe853e..0e21457e29 100644
--- a/src/view/form/control/AphrontFormControl.php
+++ b/src/view/form/control/AphrontFormControl.php
@@ -108,32 +108,32 @@ abstract class AphrontFormControl extends AphrontView {
$custom_class = $this->getCustomControlClass();
if (strlen($this->getLabel())) {
- $label =
- '';
+ $label = phutil_tag(
+ 'label',
+ array('class' => 'aphront-form-label'),
+ $this->getLabel());
} else {
$label = null;
$custom_class .= ' aphront-form-control-nolabel';
}
- $input =
- '
';
+ return phutil_tag('hr');
}
}
diff --git a/src/view/form/control/AphrontFormImageControl.php b/src/view/form/control/AphrontFormImageControl.php
index ba2adb2c92..8e84d6fefc 100644
--- a/src/view/form/control/AphrontFormImageControl.php
+++ b/src/view/form/control/AphrontFormImageControl.php
@@ -9,14 +9,14 @@ final class AphrontFormImageControl extends AphrontFormControl {
protected function renderInput() {
$id = celerity_generate_unique_node_id();
- return
+ return hsprintf(
+ '%s'.
- ' ';
+ $rows[] = hsprintf(
+ ''.$radio.' '.
- ''.$label.' '.
- ' ',
+ $radio,
+ $label);
}
- return
- '%s %s '.
- implode("\n", $rows).
- '
';
+ return phutil_tag(
+ 'table',
+ array('class' => 'aphront-form-control-radio-layout'),
+ $rows);
}
}
diff --git a/src/view/form/control/AphrontFormRecaptchaControl.php b/src/view/form/control/AphrontFormRecaptchaControl.php
index 25bc39792c..078eb1afc2 100644
--- a/src/view/form/control/AphrontFormRecaptchaControl.php
+++ b/src/view/form/control/AphrontFormRecaptchaControl.php
@@ -53,10 +53,10 @@ final class AphrontFormRecaptchaControl extends AphrontFormControl {
$protocol = $uri->getProtocol();
$use_ssl = ($protocol == 'https');
- return recaptcha_get_html(
+ return phutil_safe_html(recaptcha_get_html(
PhabricatorEnv::getEnvConfig('recaptcha.public-key'),
$error = null,
- $use_ssl);
+ $use_ssl));
}
}
diff --git a/src/view/form/control/AphrontFormStaticControl.php b/src/view/form/control/AphrontFormStaticControl.php
index d72fa37586..47060ea292 100644
--- a/src/view/form/control/AphrontFormStaticControl.php
+++ b/src/view/form/control/AphrontFormStaticControl.php
@@ -7,7 +7,7 @@ final class AphrontFormStaticControl extends AphrontFormControl {
}
protected function renderInput() {
- return phutil_escape_html($this->getValue());
+ return $this->getValue();
}
}
diff --git a/src/view/form/control/AphrontFormSubmitControl.php b/src/view/form/control/AphrontFormSubmitControl.php
index c2ccb915e5..a6f505f905 100644
--- a/src/view/form/control/AphrontFormSubmitControl.php
+++ b/src/view/form/control/AphrontFormSubmitControl.php
@@ -30,7 +30,7 @@ final class AphrontFormSubmitControl extends AphrontFormControl {
),
$this->getValue());
}
- return $submit_button.$this->cancelButton;
+ return hsprintf('%s%s', $submit_button, $this->cancelButton);
}
}
diff --git a/src/view/form/control/AphrontFormToggleButtonsControl.php b/src/view/form/control/AphrontFormToggleButtonsControl.php
index 43f83ed1b9..1c2fb3a673 100644
--- a/src/view/form/control/AphrontFormToggleButtonsControl.php
+++ b/src/view/form/control/AphrontFormToggleButtonsControl.php
@@ -46,7 +46,7 @@ final class AphrontFormToggleButtonsControl extends AphrontFormControl {
$label);
}
- return implode('', $out);
+ return $out;
}
}
diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php
index 42b5d143b8..e34f090fcb 100644
--- a/src/view/form/control/PhabricatorRemarkupControl.php
+++ b/src/view/form/control/PhabricatorRemarkupControl.php
@@ -2,10 +2,12 @@
final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
private $disableMacro = false;
+
public function setDisableMacros($disable) {
$this->disableMacro = $disable;
return $this;
}
+
protected function renderInput() {
$id = $this->getID();
if (!$id) {
--
2.51.2
From 2f508bf0dc52db7e7184c5ff740e6549cf51d0b6 Mon Sep 17 00:00:00 2001
From: vrana
',
+ "\n" => phutil_tag('br'),
',' => ', ',
);
@@ -277,7 +277,7 @@ abstract class PhabricatorController extends AphrontController {
$items[] = $this->getHandle($phid)->renderLink();
}
- return phutil_safe_html(implode($style_map[$style], $items));
+ return array_interleave($style_map[$style], $items);
}
protected function buildApplicationMenu() {
diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php
index e212d71010..a65dae3e63 100644
--- a/src/applications/config/view/PhabricatorSetupIssueView.php
+++ b/src/applications/config/view/PhabricatorSetupIssueView.php
@@ -53,20 +53,20 @@ final class PhabricatorSetupIssueView extends AphrontView {
$install_these = pht(
"Install these %d PHP extension(s):", count($extensions));
- $install_info = phutil_safe_html(pht(
- "You can usually install a PHP extension using apt-get or ".
- "yum. Common package names are ".
- "php-extname or php5-extname. ".
- "Try commands like these:"));
+ $install_info = pht(
+ "You can usually install a PHP extension using %s or %s. Common ".
+ "package names are %s or %s. Try commands like these:",
+ phutil_tag('tt', array(), 'apt-get'),
+ phutil_tag('tt', array(), 'yum'),
+ hsprintf('php-%s', pht('extname')),
+ hsprintf('php5-%s', pht('extname')));
// TODO: We should do a better job of detecting how to install extensions
// on the current system.
- $install_commands = array(
- "$ sudo apt-get install php5-extname # Debian / Ubuntu",
- "$ sudo yum install php-extname # Red Hat / Derivatives",
+ $install_commands = hsprintf(
+ "\$ sudo apt-get install php5-extname # Debian / Ubuntu\n".
+ "\$ sudo yum install php-extname # Red Hat / Derivatives"
);
- $install_commands = implode("\n", $install_commands);
- $install_commands = phutil_safe_html($install_commands);
$fallback_info = pht(
"If those commands don't work, try Google. The process of installing ".
@@ -76,8 +76,8 @@ final class PhabricatorSetupIssueView extends AphrontView {
$restart_info = pht(
"After installing new PHP extensions, restart your webserver ".
- "for the changes to take effect.");
- $restart_info = phutil_safe_html($restart_info);
+ "for the changes to take effect.",
+ hsprintf(''));
$description[] = phutil_tag(
'div',
@@ -274,17 +274,19 @@ final class PhabricatorSetupIssueView extends AphrontView {
$info[] = phutil_tag(
'p',
array(),
- phutil_safe_html(pht(
+ pht(
'You can find more information about PHP configuration values in the '.
'PHP Documentation.',
- 'http://php.net/manual/ini.list.php')));
+ 'http://php.net/manual/ini.list.php',
+ hsprintf('')));
$info[] = phutil_tag(
'p',
array(),
- phutil_safe_html(pht(
+ pht(
"After editing the PHP configuration, restart your ".
- "webserver for the changes to take effect.")));
+ "webserver for the changes to take effect.",
+ hsprintf('')));
return phutil_tag(
'div',
diff --git a/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php b/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php
index 09da33abc2..05c8ebef91 100644
--- a/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php
@@ -26,7 +26,7 @@ final class DifferentialDependsOnFieldSpecification
$links[] = $this->getHandle($revision_phids)->renderLink();
}
- return phutil_safe_html(implode('
', $links));
+ return array_interleave(phutil_tag('br'), $links);
}
private function getDependentRevisionPHIDs() {
diff --git a/src/applications/differential/field/specification/DifferentialFieldSpecification.php b/src/applications/differential/field/specification/DifferentialFieldSpecification.php
index 9453668fae..d1b6dbdb3b 100644
--- a/src/applications/differential/field/specification/DifferentialFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialFieldSpecification.php
@@ -283,7 +283,7 @@ abstract class DifferentialFieldSpecification {
$links[] = $handle->renderLink();
}
- return phutil_safe_html(implode(', ', $links));
+ return array_interleave(', ', $links);
}
diff --git a/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php b/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
index 36080efee4..8cf2bfab8d 100644
--- a/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
@@ -43,7 +43,7 @@ final class DifferentialLintFieldSpecification
$rows[] = array(
'style' => 'star',
- 'name' => phutil_safe_html($lstar),
+ 'name' => $lstar,
'value' => $lmsg,
'show' => true,
);
@@ -53,7 +53,7 @@ final class DifferentialLintFieldSpecification
$rows[] = array(
'style' => 'excuse',
'name' => 'Excuse',
- 'value' => phutil_safe_html(nl2br(phutil_escape_html($excuse))),
+ 'value' => phutil_escape_html_newlines($excuse),
'show' => true,
);
}
@@ -131,10 +131,7 @@ final class DifferentialLintFieldSpecification
if (strlen($description)) {
$rows[] = array(
'style' => 'details',
- 'value' =>
- phutil_safe_html(
- nl2br(
- phutil_escape_html($description))),
+ 'value' => phutil_escape_html_newlines($description),
'show' => false,
);
if (empty($hidden['details'])) {
diff --git a/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php b/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php
index 44890675bd..38379da8f2 100644
--- a/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php
@@ -29,7 +29,7 @@ final class DifferentialManiphestTasksFieldSpecification
$links[] = $this->getHandle($task_phid)->renderLink();
}
- return phutil_safe_html(implode('
', $links));
+ return array_interleave(phutil_tag('br'), $links);
}
private function getManiphestTaskPHIDs() {
diff --git a/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php b/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
index b19ae2f798..0e442314a6 100644
--- a/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
@@ -37,7 +37,7 @@ final class DifferentialUnitFieldSpecification
$rows[] = array(
'style' => 'star',
- 'name' => phutil_safe_html($ustar),
+ 'name' => $ustar,
'value' => $umsg,
'show' => true,
);
@@ -47,7 +47,7 @@ final class DifferentialUnitFieldSpecification
$rows[] = array(
'style' => 'excuse',
'name' => 'Excuse',
- 'value' => phutil_safe_html(nl2br(phutil_escape_html($excuse))),
+ 'value' => phutil_escape_html_newlines($excuse),
'show' => true,
);
}
diff --git a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
index 718d837f53..67e6ee4da4 100644
--- a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
+++ b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
@@ -293,10 +293,10 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
private static function renderDiffStar($star) {
$class = 'diff-star-'.$star;
- return
- ''.
- "\xE2\x98\x85".
- '';
+ return phutil_tag(
+ 'span',
+ array('class' => $class),
+ "\xE2\x98\x85");
}
private function renderBaseRevision(DifferentialDiff $diff) {
diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php
index cc30b41141..3025434485 100644
--- a/src/applications/diffusion/controller/DiffusionController.php
+++ b/src/applications/diffusion/controller/DiffusionController.php
@@ -247,8 +247,7 @@ abstract class DiffusionController extends PhabricatorController {
case 'change':
$view_name = 'Change';
$crumb_list[] = $crumb->setName(
- phutil_safe_html(
- phutil_escape_html($path).' ('.$commit_link.')'));
+ hsprintf('%s (%s)', $path, $commit_link));
return $crumb_list;
}
@@ -278,6 +277,7 @@ abstract class DiffusionController extends PhabricatorController {
$thus_far = '';
foreach ($path_parts as $path_part) {
$thus_far .= $path_part.'/';
+ $path_sections[] = '/';
$path_sections[] = phutil_tag(
'a',
array(
@@ -289,11 +289,10 @@ abstract class DiffusionController extends PhabricatorController {
$path_part);
}
- $path_sections[] = phutil_escape_html($last);
- $path_sections = '/'.implode('/', $path_sections);
+ $path_sections[] = '/'.$last;
$crumb_list[] = id(new PhabricatorCrumbView())
- ->setName(phutil_safe_html($path_sections));
+ ->setName($path_sections);
}
$last_crumb = array_pop($crumb_list);
@@ -310,11 +309,11 @@ abstract class DiffusionController extends PhabricatorController {
'Jump to HEAD');
$name = $last_crumb->getName();
- $name = phutil_safe_html($name." @ {$commit_link} ({$jump_link})");
+ $name = hsprintf('%s @ %s (%s)', $name, $commit_link, $jump_link);
$last_crumb->setName($name);
} else if ($spec['view'] != 'lint') {
$name = $last_crumb->getName();
- $name = phutil_safe_html($name.' @ HEAD');
+ $name = hsprintf('%s @ HEAD', $name);
$last_crumb->setName($name);
}
diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php
index b5fee57e90..6371e5ad2e 100644
--- a/src/applications/herald/controller/HeraldRuleController.php
+++ b/src/applications/herald/controller/HeraldRuleController.php
@@ -134,8 +134,7 @@ final class HeraldRuleController extends HeraldController {
),
'Create New Condition'))
->setDescription(
- phutil_safe_html(
- 'When '.$must_match_selector.' these conditions are met:'))
+ hsprintf('When %s these conditions are met:', $must_match_selector))
->setContent(javelin_tag(
'table',
array(
diff --git a/src/applications/phame/view/PhamePostView.php b/src/applications/phame/view/PhamePostView.php
index 8c5a47c452..874d4c0513 100644
--- a/src/applications/phame/view/PhamePostView.php
+++ b/src/applications/phame/view/PhamePostView.php
@@ -162,15 +162,16 @@ final class PhamePostView extends AphrontView {
'');
$c_uri = '//connect.facebook.net/en_US/all.js#xfbml=1&appId='.$fb_id;
- $fb_js = phutil_safe_html(
+ $fb_js = hsprintf(
+ '',
jsprintf(
- '',
+ '}(document, \'script\', \'facebook-jssdk\'));',
$c_uri));
@@ -211,9 +212,9 @@ final class PhamePostView extends AphrontView {
);
// protip - try some var disqus_developer = 1; action to test locally
- $disqus_js = phutil_safe_html(
+ $disqus_js = hsprintf(
+ '',
jsprintf(
- '',
+ '})();',
$post->getPHID(),
$this->getSkin()->getURI('post/'.$this->getPost()->getPhameTitle()),
$post->getTitle()));
diff --git a/src/applications/uiexample/examples/PhabricatorPropertyListExample.php b/src/applications/uiexample/examples/PhabricatorPropertyListExample.php
index 0e0e6dc2ec..9ac216d82b 100644
--- a/src/applications/uiexample/examples/PhabricatorPropertyListExample.php
+++ b/src/applications/uiexample/examples/PhabricatorPropertyListExample.php
@@ -49,7 +49,7 @@ final class PhabricatorPropertyListExample extends PhabricatorUIExample {
$view->addSectionHeader('Haiku About Pasta');
$view->addTextContent(
- phutil_safe_html(
+ hsprintf(
'this is a pasta
'.
'haiku. it is very bad.
'.
'what did you expect?'));
--
2.51.2
From f864d9e61132aa64de59f2c56d71ac92a084c0d4 Mon Sep 17 00:00:00 2001
From: vrana '.$data.'
';
- return $data;
+ return phutil_tag('pre', array(), $data);
}
}
diff --git a/src/view/control/AphrontTokenizerTemplateView.php b/src/view/control/AphrontTokenizerTemplateView.php
index d80fe2566c..4e4e442593 100644
--- a/src/view/control/AphrontTokenizerTemplateView.php
+++ b/src/view/control/AphrontTokenizerTemplateView.php
@@ -84,7 +84,7 @@ final class AphrontTokenizerTemplateView extends AphrontView {
'type' => 'hidden',
'name' => $input_name,
'value' => $key,
- )).
+ )),
phutil_tag('span', array('class' => 'jx-tokenizer-x-placeholder'), ''),
));
}
--
2.51.2
From 059920c2dac57147116a706a7205c51c69d3ff3a Mon Sep 17 00:00:00 2001
From: vrana
'.
'
'.
- ''.phutil_escape_html(get_class($ex)).' '.
- nl2br(phutil_escape_html($ex->getMessage())));
+ '%s %s',
+ get_class($ex),
+ phutil_escape_html_newlines($ex->getMessage())));
}
return $this->buildStandardPageResponse(
diff --git a/src/applications/people/controller/PhabricatorEmailVerificationController.php b/src/applications/people/controller/PhabricatorEmailVerificationController.php
index 221df9d2a5..80432f15b0 100644
--- a/src/applications/people/controller/PhabricatorEmailVerificationController.php
+++ b/src/applications/people/controller/PhabricatorEmailVerificationController.php
@@ -30,7 +30,9 @@ final class PhabricatorEmailVerificationController
'href' => '/',
),
'Continue to Phabricator');
- $home_link = ''.
- 'phabricator/ $ ./scripts/repository/test_connection.php '.
- phutil_escape_html($repository->getCallsign()).
+ 'phabricator/ $ ./scripts/repository/test_connection.php %s'.
''.
'This will verify that your configuration is correct and the '.
'daemons can connect to the remote repository and pull changes '.
'from it.'.
- '
If you only want to parse one '. 'subpath of the repository, specify it here, relative to the '. 'repository root (e.g., trunk/ or projects/wheel/). '. 'If you want to parse multiple subdirectories, create a separate '. - 'Phabricator repository for each one.
'); + 'Phabricator repository for each one.')); $inset->appendChild( id(new AphrontFormTextControl()) ->setName('svn-subpath') diff --git a/src/view/form/AphrontFormInsetView.php b/src/view/form/AphrontFormInsetView.php index 185e5ead19..014cdfffdd 100644 --- a/src/view/form/AphrontFormInsetView.php +++ b/src/view/form/AphrontFormInsetView.php @@ -48,11 +48,7 @@ final class AphrontFormInsetView extends AphrontView { public function render() { - $title = $hidden_inputs = $right_button = $desc = $content = ''; - - if ($this->title) { - $title = ''.$body.'
') + ->appendChild(hsprintf( + '%s
', + $body)) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue("{$button} \xC2\xBB")); @@ -289,9 +289,9 @@ final class PhabricatorLoginController $panel->setWidth(AphrontPanelView::WIDTH_FORM); $panel->setNoBackground(); foreach ($forms as $name => $form) { - $panel->appendChild('Enter parameters using '. 'JSON. For instance, to enter a list, type: '. - '["apple", "banana", "cherry"]'); + '["apple", "banana", "cherry"]')); $params = $method_object->defineParamTypes(); foreach ($params as $param => $desc) { diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php index 054e69cb90..b141bcb17d 100644 --- a/src/applications/differential/controller/DifferentialDiffCreateController.php +++ b/src/applications/differential/controller/DifferentialDiffCreateController.php @@ -41,12 +41,15 @@ final class DifferentialDiffCreateController extends DifferentialController { ->setAction('/differential/diff/create/') ->setEncType('multipart/form-data') ->setUser($request->getUser()) - ->appendChild( - '
'.pht('The best way to create '. - 'a Differential diff is by using %s, but you '. - 'can also just paste a diff (e.g., from svn diff or '. - 'git diff) into this box or upload it as a file if you '. - 'really want.', $arcanist_link).'
') + ->appendChild(hsprintf( + '%s
', + pht( + 'The best way to create a Differential diff is by using %s, but you '. + 'can also just paste a diff (e.g., from %s or %s) into this box '. + 'or upload it as a file if you really want.', + $arcanist_link, + phutil_tag('tt', array(), 'svn diff'), + phutil_tag('tt', array(), 'git diff')))) ->appendChild( id(new AphrontFormTextAreaControl()) ->setLabel(pht('Raw Diff')) diff --git a/src/applications/herald/controller/HeraldTestConsoleController.php b/src/applications/herald/controller/HeraldTestConsoleController.php index 8856c879c4..f0225d7081 100644 --- a/src/applications/herald/controller/HeraldTestConsoleController.php +++ b/src/applications/herald/controller/HeraldTestConsoleController.php @@ -96,11 +96,11 @@ final class HeraldTestConsoleController extends HeraldController { $form = id(new AphrontFormView()) ->setUser($user) - ->appendChild( + ->appendChild(hsprintf( 'Enter an object to test rules '. 'for, like a Diffusion commit (e.g., rX123) or a '. 'Differential revision (e.g., D123). You will be shown the '. - 'results of a dry run on the object.
') + 'results of a dry run on the object.')) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Object Name')) diff --git a/src/applications/maniphest/controller/ManiphestBatchEditController.php b/src/applications/maniphest/controller/ManiphestBatchEditController.php index 6e1b533e45..7ecd0db24c 100644 --- a/src/applications/maniphest/controller/ManiphestBatchEditController.php +++ b/src/applications/maniphest/controller/ManiphestBatchEditController.php @@ -96,7 +96,7 @@ final class ManiphestBatchEditController extends ManiphestController { 'name' => 'actions', 'id' => 'batch-form-actions', ))); - $form->appendChild('These tasks will be edited:
'); + $form->appendChild(phutil_tag('p', array(), 'These tasks will be edited:')); $form->appendChild($list); $form->appendChild( id(new AphrontFormInsetView()) diff --git a/src/applications/maniphest/view/ManiphestTaskListView.php b/src/applications/maniphest/view/ManiphestTaskListView.php index b27beeb633..f808ab9104 100644 --- a/src/applications/maniphest/view/ManiphestTaskListView.php +++ b/src/applications/maniphest/view/ManiphestTaskListView.php @@ -45,7 +45,7 @@ final class ManiphestTaskListView extends ManiphestView { $views[] = $view->render(); } - return implode("\n", $views); + return $this->renderHTMLView($views); } } diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAReceiveController.php b/src/applications/metamta/controller/PhabricatorMetaMTAReceiveController.php index ccf1410f39..fde8a1d468 100644 --- a/src/applications/metamta/controller/PhabricatorMetaMTAReceiveController.php +++ b/src/applications/metamta/controller/PhabricatorMetaMTAReceiveController.php @@ -49,10 +49,9 @@ final class PhabricatorMetaMTAReceiveController $form->setUser($request->getUser()); $form->setAction($this->getApplicationURI('/receive/')); $form - ->appendChild( - ''. - pht('This form will simulate sending mail to an object.'). - '
') + ->appendChild(hsprintf( + '%s
', + pht('This form will simulate sending mail to an object.'))) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('To')) diff --git a/src/applications/metamta/controller/PhabricatorMetaMTASendController.php b/src/applications/metamta/controller/PhabricatorMetaMTASendController.php index bd423186cd..0540ff189f 100644 --- a/src/applications/metamta/controller/PhabricatorMetaMTASendController.php +++ b/src/applications/metamta/controller/PhabricatorMetaMTASendController.php @@ -55,11 +55,12 @@ final class PhabricatorMetaMTASendController 'target' => '_blank', ), pht('Configuring Outbound Email')); - $instructions = - ''. - pht('This form will send a normal email using the settings you have '. - 'configured for Phabricator. For more information, see %s.', $doclink). - '
'; + $instructions = hsprintf( + '%s
', + pht( + 'This form will send a normal email using the settings you have '. + 'configured for Phabricator. For more information, see %s.', + $doclink)); $adapter = PhabricatorEnv::getEnvConfig('metamta.mail-adapter'); $warning = null; diff --git a/src/applications/people/controller/PhabricatorPeopleEditController.php b/src/applications/people/controller/PhabricatorPeopleEditController.php index bedf1b43fa..78100bf21d 100644 --- a/src/applications/people/controller/PhabricatorPeopleEditController.php +++ b/src/applications/people/controller/PhabricatorPeopleEditController.php @@ -393,9 +393,9 @@ final class PhabricatorPeopleEditController ->setAction($request->getRequestURI()->alter('saved', null)); if ($is_self) { - $form->appendChild( + $form->appendChild(hsprintf( 'NOTE: You can not edit your own '. - 'role.
'); + 'role.')); } $form @@ -448,10 +448,10 @@ final class PhabricatorPeopleEditController $form ->setUser($admin) ->setAction($request->getRequestURI()) - ->appendChild( + ->appendChild(hsprintf( 'You can use this certificate '. 'to write scripts or bots which interface with Phabricator over '. - 'Conduit.
'); + 'Conduit.')); if ($user->getIsSystemAgent()) { $form @@ -530,7 +530,7 @@ final class PhabricatorPeopleEditController $form ->setUser($admin) ->setAction($request->getRequestURI()) - ->appendChild( + ->appendChild(hsprintf( ''. 'Be careful when renaming users! '. 'The old username will no longer be tied to the user, so anything '. @@ -549,7 +549,7 @@ final class PhabricatorPeopleEditController 'after their username is changed (their username is part of the '. 'salt in the password hash). They will receive an email with '. 'instructions on how to do this.'. - '
') + '')) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel('Old Username') @@ -622,7 +622,7 @@ final class PhabricatorPeopleEditController $form ->setUser($admin) ->setAction($request->getRequestURI()) - ->appendChild( + ->appendChild(hsprintf( ''. 'Be careful when deleting users! '. 'If this user interacted with anything, it is generally better '. @@ -636,7 +636,7 @@ final class PhabricatorPeopleEditController 'It is generally safe to delete newly created users (and test users '. 'and so on), but less safe to delete established users. If '. 'possible, disable them instead.'. - '
') + '')) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel('Username') @@ -670,11 +670,11 @@ final class PhabricatorPeopleEditController ), 'User Guide: Account Roles'); - return + return hsprintf( ''. - 'For a detailed explanation of account roles, see '. - $roles_link.'.'. - '
'; + 'For a detailed explanation of account roles, see %s.'. + '', + $roles_link); } } diff --git a/src/applications/project/controller/PhabricatorProjectProfileEditController.php b/src/applications/project/controller/PhabricatorProjectProfileEditController.php index fcdcb34942..83bdf90a59 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileEditController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileEditController.php @@ -168,10 +168,10 @@ final class PhabricatorProjectProfileEditController ->setLabel('Blurb') ->setName('blurb') ->setValue($profile->getBlurb())) - ->appendChild( + ->appendChild(hsprintf( 'NOTE: Policy settings are not '. 'yet fully implemented. Some interfaces still ignore these settings, '. - 'particularly "Visible To".
') + 'particularly "Visible To".')) ->appendChild( id(new AphrontFormPolicyControl()) ->setUser($user) diff --git a/src/applications/repository/controller/PhabricatorRepositoryCreateController.php b/src/applications/repository/controller/PhabricatorRepositoryCreateController.php index 698e3105c7..179ad55f41 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryCreateController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryCreateController.php @@ -78,11 +78,11 @@ final class PhabricatorRepositoryCreateController ->setValue($repository->getName()) ->setError($e_name) ->setCaption('Human-readable repository name.')) - ->appendChild( + ->appendChild(hsprintf( 'Select a "Callsign" — a '. 'short, uppercase string to identify revisions in this repository. If '. 'you choose "EX", revisions in this repository will be identified '. - 'with the prefix "rEX".
') + 'with the prefix "rEX".')) ->appendChild( id(new AphrontFormTextControl()) ->setLabel('Callsign') diff --git a/src/applications/repository/controller/PhabricatorRepositoryEditController.php b/src/applications/repository/controller/PhabricatorRepositoryEditController.php index f995c97229..0a1a0ca364 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryEditController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryEditController.php @@ -122,16 +122,15 @@ final class PhabricatorRepositoryEditController ->setLabel('Callsign') ->setName('callsign') ->setValue($repository->getCallsign())) - ->appendChild(' + ->appendChild(hsprintf(''. 'If source code in this repository uses a character '. 'encoding other than UTF-8 (for example, ISO-8859-1), '. 'specify it here. You can usually leave this field blank. '. 'See User Guide: '. - ''. - 'UTF-8 and Character Encoding'. - ' for more information.'. - '
') + 'UTF-8 and Character Encoding for more information.'. + '', + $encoding_doc_link)) ->appendChild( id(new AphrontFormTextControl()) ->setLabel('Encoding') @@ -358,13 +357,14 @@ final class PhabricatorRepositoryEditController $form ->setUser($user) ->setAction('/repository/edit/'.$repository->getID().'/tracking/') - ->appendChild( + ->appendChild(hsprintf( 'Phabricator can track '. 'repositories, importing commits as they happen and notifying '. 'Differential, Diffusion, Herald, and other services. To enable '. 'tracking for a repository, configure it here and then start (or '. 'restart) the daemons. More information is available in the '. - ''.$user_guide_link.'.
'); + '%s.', + $user_guide_link)); $form ->appendChild( diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php b/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php index a80a32d222..d4ccec4194 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php @@ -67,10 +67,10 @@ final class PhabricatorSettingsPanelConduit $cert_form = new AphrontFormView(); $cert_form ->setUser($user) - ->appendChild( + ->appendChild(hsprintf( 'This certificate allows you to '. 'authenticate over Conduit, the Phabricator API. Normally, you just '. - 'run arc install-certificate to install it.') + 'run arc install-certificate to install it.')) ->appendChild( id(new AphrontFormTextAreaControl()) ->setLabel('Certificate') @@ -87,10 +87,10 @@ final class PhabricatorSettingsPanelConduit ->setUser($user) ->setAction($this->getPanelURI()) ->setWorkflow(true) - ->appendChild( + ->appendChild(hsprintf( '
You can regenerate this '. 'certificate, which will invalidate the old certificate and create '. - 'a new one.
') + 'a new one.')) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue('Regenerate Certificate')); diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php index f3e3c55c2a..58d913db95 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php @@ -165,7 +165,7 @@ final class PhabricatorSettingsPanelEmailPreferences 'break threading in some clients.')); $form - ->appendChild( + ->appendChild(hsprintf( ''. 'You can customize what mail you receive from Phabricator here.'. @@ -176,7 +176,7 @@ final class PhabricatorSettingsPanelEmailPreferences 'still receive an email as long as at least one of the changes '. 'is set to notify you.'. '
' - ); + )); $mailtags = $preferences->getPreference('mailtags', array()); diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelLDAP.php b/src/applications/settings/panel/PhabricatorSettingsPanelLDAP.php index ebff08540a..25df530fdb 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelLDAP.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelLDAP.php @@ -35,10 +35,11 @@ final class PhabricatorSettingsPanelLDAP $unlink_form ->setUser($user) ->setAction('/ldap/login/') - ->appendChild( + ->appendChild(hsprintf( 'There is currently no '. - 'LDAP account linked to your Phabricator account. You can link an ' . - 'account, which will allow you to use it to log into Phabricator
') + 'LDAP account linked to your Phabricator account. You can link an '. + 'account, which will allow you to use it to log into Phabricator.'. + '')) ->appendChild( id(new AphrontFormTextControl()) ->setLabel('LDAP username') @@ -57,10 +58,10 @@ final class PhabricatorSettingsPanelLDAP $unlink_form = new AphrontFormView(); $unlink_form ->setUser($user) - ->appendChild( + ->appendChild(hsprintf( 'You may unlink this account '. 'from your LDAP account. This will prevent you from logging in with '. - 'your LDAP credentials.
') + 'your LDAP credentials.')) ->appendChild( id(new AphrontFormSubmitControl()) ->addCancelButton('/ldap/unlink/', $unlink)); diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelOAuth.php b/src/applications/settings/panel/PhabricatorSettingsPanelOAuth.php index 41565afbdb..b95640ba48 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelOAuth.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelOAuth.php @@ -84,11 +84,12 @@ final class PhabricatorSettingsPanelOAuth $forms[] = $form; if (!$oauth_info) { $form - ->appendChild( - 'There is currently no '. - phutil_escape_html($provider_name).' account linked to your '. - 'Phabricator account. You can link an account, which will allow you '. - 'to use it to log into Phabricator.
'); + ->appendChild(hsprintf( + 'There is currently no %s '. + 'account linked to your Phabricator account. You can link an '. + 'account, which will allow you to use it to log into Phabricator.'. + '
', + $provider_name)); $this->prepareAuthForm($form); @@ -100,11 +101,12 @@ final class PhabricatorSettingsPanelOAuth $expires = $oauth_info->getTokenExpires(); $form - ->appendChild( + ->appendChild(hsprintf( 'Your account is linked with '. - 'a '.phutil_escape_html($provider_name).' account. You may use your '. - phutil_escape_html($provider_name).' credentials to log into '. - 'Phabricator.
') + 'a %s account. You may use your %s credentials to log into '. + 'Phabricator.', + $provider_name, + $provider_name)) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel($provider_name.' ID') @@ -133,11 +135,12 @@ final class PhabricatorSettingsPanelOAuth $unlink_form = new AphrontFormView(); $unlink_form ->setUser($user) - ->appendChild( + ->appendChild(hsprintf( 'You may unlink this account '. - 'from your '.phutil_escape_html($provider_name).' account. This '. - 'will prevent you from logging in with your '. - phutil_escape_html($provider_name).' credentials.
') + 'from your %s account. This will prevent you from logging in '. + 'with your %s credentials.', + $provider_name, + $provider_name)) ->appendChild( id(new AphrontFormSubmitControl()) ->addCancelButton('/oauth/'.$provider_key.'/unlink/', $unlink)); @@ -165,18 +168,22 @@ final class PhabricatorSettingsPanelOAuth $rappable_status = PhabricatorUserOAuthInfo::getRappableTokenStatus( $status); $beat = self::getBeat(); - $rap = $beat . "Yo yo yo'.$rap.'
') + ->appendChild(hsprintf( + '%s
', + $rap)) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel('Token Status') @@ -282,12 +289,12 @@ final class PhabricatorSettingsPanelOAuth private static function getBeat() { // Gangsta's Paradise (karaoke version). // Chosen because it's the only thing I listen to. - $song_id = "Gangsta\\'s Paradise"; + $song_id = "Gangsta's Paradise"; // Make a musical note which you can click for the beat. - $beat = '♫ '; + $beat = hsprintf( + '♫', + jsprintf('alert(%s); return 0;', "Think about {$song_id}.")); return $beat; } } diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelProfile.php b/src/applications/settings/panel/PhabricatorSettingsPanelProfile.php index d78cbbcd6a..a668967dba 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelProfile.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelProfile.php @@ -182,10 +182,10 @@ final class PhabricatorSettingsPanelProfile 'href' => $profile_uri, ), $profile_uri))) - ->appendChild( + ->appendChild(hsprintf( 'Write something about yourself! '. 'Make sure to include important information like '. - 'your favorite Pokemon and which Starcraft race you play.
') + 'your favorite Pokemon and which Starcraft race you play.')) ->appendChild( id(new AphrontFormTextAreaControl()) ->setLabel('Blurb') diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteCreateController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteCreateController.php index 3f3d5f1b6d..9ffa72245f 100644 --- a/src/applications/slowvote/controller/PhabricatorSlowvoteCreateController.php +++ b/src/applications/slowvote/controller/PhabricatorSlowvoteCreateController.php @@ -65,9 +65,9 @@ final class PhabricatorSlowvoteCreateController $form = id(new AphrontFormView()) ->setUser($user) - ->appendChild( + ->appendChild(hsprintf( 'Resolve issues and build '. - 'consensus through protracted deliberation.
') + 'consensus through protracted deliberation.')) ->appendChild( id(new AphrontFormTextControl()) ->setLabel('Question') diff --git a/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php b/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php index 9440e476b4..95938fa958 100644 --- a/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php +++ b/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php @@ -158,8 +158,9 @@ final class PhabricatorSlowvotePollController $form = id(new AphrontFormView()) ->setUser($user) - ->appendChild( - ''.$instructions.'
') + ->appendChild(hsprintf( + '%s
', + $instructions)) ->appendChild( id(new AphrontFormMarkupControl()) ->setLabel('Vote') -- 2.51.2 From 7dd19ba93fb60001b859f070359c640bc340af7c Mon Sep 17 00:00:00 2001 From: vranaYou can flag this {$type_name} if you want to remember to look ". - "at it later.
You can flag this %s if you want to remember to look ". + "at it later.
'.$reason.'
'); + ->appendChild(hsprintf( + '%s
', + $reason)); return $result_markup; } @@ -414,7 +415,6 @@ final class PhabricatorSlowvotePollController 'src' => $profile_image, ))); } - $user_markup = implode('', $user_markup); } else { $user_markup = 'This option has failed to appeal to anyone.'; } @@ -428,18 +428,20 @@ final class PhabricatorSlowvotePollController $choices, $chosen); - $result_markup->appendChild( + $result_markup->appendChild(hsprintf( ''. 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_escape_html($email_address)). + 'inbox (%s).', phutil_tag('strong', array(), $email_address)). '
'); $error_view->appendChild( ''. diff --git a/src/applications/auth/controller/PhabricatorOAuthLoginController.php b/src/applications/auth/controller/PhabricatorOAuthLoginController.php index 2a6c9da6e1..dbfcc81810 100644 --- a/src/applications/auth/controller/PhabricatorOAuthLoginController.php +++ b/src/applications/auth/controller/PhabricatorOAuthLoginController.php @@ -69,14 +69,16 @@ final class PhabricatorOAuthLoginController $dialog = new AphrontDialogView(); $dialog->setUser($current_user); $dialog->setTitle(pht('Already Linked to Another Account')); - $dialog->appendChild('
'. + $dialog->appendChild(phutil_tag( + 'p', + array(), pht( '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.
', - phutil_escape_html($provider_name), - phutil_escape_html($provider_name))).''; + 'the Phabricator account it is currently linked to.', + $provider_name, + $provider_name))); $dialog->addCancelButton($provider->getSettingsPanelURI()); return id(new AphrontDialogResponse())->setDialog($dialog); @@ -97,13 +99,15 @@ final class PhabricatorOAuthLoginController $dialog->setUser($current_user); $dialog->setTitle( pht('Already Linked to an Account From This Provider')); - $dialog->appendChild(''. + $dialog->appendChild(phutil_tag( + 'p', + array(), pht( '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.
', - phutil_escape_html($provider_name), - phutil_escape_html($provider_name))).''; + 'must unlink the old account.', + $provider_name, + $provider_name))); $dialog->addCancelButton($provider->getSettingsPanelURI()); return id(new AphrontDialogResponse())->setDialog($dialog); } @@ -170,13 +174,15 @@ final class PhabricatorOAuthLoginController $dialog = new AphrontDialogView(); $dialog->setUser($current_user); $dialog->setTitle(pht('Already Linked to Another Account')); - $dialog->appendChild(''. + $dialog->appendChild(phutil_tag( + 'p', + array(), pht( '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.', - phutil_escape_html($provider_name))).'
'; + $provider_name))); $user = id(new PhabricatorUser()) ->loadOneWhere('phid = %s', $known_email->getUserPHID()); @@ -189,10 +195,12 @@ final class PhabricatorOAuthLoginController $providers[] = PhabricatorOAuthProvider::newProvider($provider) ->getProviderName(); } - $dialog->appendChild( + $dialog->appendChild(phutil_tag( + 'p', + array(), pht( - 'The account is associated with: %s.
', - implode(', ', phutil_escape_html($providers)))); + 'The account is associated with: %s.', + implode(', ', $providers)))); } $dialog->addCancelButton('/login/'); @@ -205,13 +213,15 @@ final class PhabricatorOAuthLoginController $dialog = new AphrontDialogView(); $dialog->setUser($current_user); $dialog->setTitle(pht('No Account Registration with %s', $provider_name)); - $dialog->appendChild(''. + $dialog->appendChild(phutil_tag( + 'p', + array(), pht( '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.', - phutil_escape_html($provider_name), - phutil_escape_html($provider_name))).'
'; + $provider_name, + $provider_name))); $dialog->addCancelButton('/login/'); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php b/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php index d544723cd2..db1ab235f0 100644 --- a/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php +++ b/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php @@ -33,9 +33,9 @@ final class PhabricatorCountdownDeleteController $dialog = new AphrontDialogView(); $dialog->setUser($request->getUser()); $dialog->setTitle('Really delete this countdown?'); - $dialog->appendChild( - 'Are you sure you want to delete the countdown "'. - phutil_escape_html($timer->getTitle()).'"?
'); + $dialog->appendChild(hsprintf( + 'Are you sure you want to delete the countdown "%s"?
', + $timer->getTitle())); $dialog->addSubmitButton('Delete'); $dialog->addCancelButton('/countdown/'); $dialog->setSubmitURI($request->getPath()); diff --git a/src/applications/countdown/controller/PhabricatorCountdownViewController.php b/src/applications/countdown/controller/PhabricatorCountdownViewController.php index 6e084a3835..ed27dfdb58 100644 --- a/src/applications/countdown/controller/PhabricatorCountdownViewController.php +++ b/src/applications/countdown/controller/PhabricatorCountdownViewController.php @@ -32,12 +32,9 @@ final class PhabricatorCountdownViewController $chrome_visible ? pht('Disable Chrome') : pht('Enable Chrome')); $container = celerity_generate_unique_node_id(); - $content = - '| Minutes | Seconds |
|---|---|
'.phutil_escape_html($no_effect->getMessage()).'
'); + phutil_tag('p', array(), $no_effect->getMessage())); if (strlen($comment) || $has_inlines) { $dialog->addSubmitButton(pht('Post as Comment')); diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php index 4efe69250a..3032e15cc1 100644 --- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php @@ -70,10 +70,7 @@ abstract class DifferentialChangesetHTMLRenderer break; case DifferentialChangeType::TYPE_MOVE_HERE: - $from = - "". - phutil_escape_html($changeset->getOldFile()). - ""; + $from = phutil_tag('strong', array(), $changeset->getOldFile()); switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was moved from %s.', $from); @@ -97,10 +94,7 @@ abstract class DifferentialChangesetHTMLRenderer break; case DifferentialChangeType::TYPE_COPY_HERE: - $from = - "". - phutil_escape_html($changeset->getOldFile()). - ""; + $from = phutil_tag('strong', array(), $changeset->getOldFile()); switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was copied from %s.', $from); @@ -124,10 +118,10 @@ abstract class DifferentialChangesetHTMLRenderer break; case DifferentialChangeType::TYPE_MOVE_AWAY: - $paths = - "". - phutil_escape_html(implode(', ', $changeset->getAwayPaths())). - ""; + $paths = phutil_tag( + 'strong', + array(), + implode(', ', $changeset->getAwayPaths())); switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was moved to %s.', $paths); @@ -151,10 +145,10 @@ abstract class DifferentialChangesetHTMLRenderer break; case DifferentialChangeType::TYPE_COPY_AWAY: - $paths = - "". - phutil_escape_html(implode(', ', $changeset->getAwayPaths())). - ""; + $paths = phutil_tag( + 'strong', + array(), + implode(', ', $changeset->getAwayPaths())); switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was copied to %s.', $paths); @@ -178,10 +172,10 @@ abstract class DifferentialChangesetHTMLRenderer break; case DifferentialChangeType::TYPE_MULTICOPY: - $paths = - "". - phutil_escape_html(implode(', ', $changeset->getAwayPaths())). - ""; + $paths = phutil_tag( + 'strong', + array(), + implode(', ', $changeset->getAwayPaths())); switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht( @@ -262,23 +256,26 @@ abstract class DifferentialChangesetHTMLRenderer $nval = idx($new, $key); if ($oval !== $nval) { if ($oval === null) { - $oval = 'null'; + $oval = phutil_tag('em', array(), 'null'); } else { - $oval = nl2br(phutil_escape_html($oval)); + $oval = phutil_escape_html_newlines($oval); } if ($nval === null) { - $nval = 'null'; + $nval = phutil_tag('em', array(), 'null'); } else { - $nval = nl2br(phutil_escape_html($nval)); + $nval = phutil_escape_html_newlines($nval); } - $rows[] = + $rows[] = hsprintf( ''.phutil_escape_html($flavor).'
'. - '%s
'. + '', + $link, + $flavor); } $out = diff --git a/src/applications/feed/story/PhabricatorFeedStory.php b/src/applications/feed/story/PhabricatorFeedStory.php index b9715efca6..c94392b302 100644 --- a/src/applications/feed/story/PhabricatorFeedStory.php +++ b/src/applications/feed/story/PhabricatorFeedStory.php @@ -243,15 +243,14 @@ abstract class PhabricatorFeedStory implements PhabricatorPolicyInterface { } final protected function renderString($str) { - return ''.phutil_escape_html($str).''; + return phutil_tag('strong', array(), $str); } final protected function renderSummary($text, $len = 128) { if ($len) { $text = phutil_utf8_shorten($text, $len); } - $text = phutil_escape_html($text); - $text = str_replace("\n", 'Permanently delete '".phutil_escape_html($file->getName())."'? This ". - "action can not be undone."); + $dialog->appendChild(hsprintf( + "
Permanently delete '%s'? This action can not be undone.
", + $file->getName())); $dialog->addSubmitButton('Delete'); $dialog->addCancelButton($file->getInfoURI()); diff --git a/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php b/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php index 73c300cc2f..784f223011 100644 --- a/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php +++ b/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php @@ -25,14 +25,16 @@ final class PhabricatorHelpKeyboardShortcutController foreach ($keys as $shortcut) { $keystrokes = array(); foreach ($shortcut['keys'] as $stroke) { - $keystrokes[] = ''.phutil_escape_html($stroke).''; + $keystrokes[] = phutil_tag('kbd', array(), $stroke); } - $keystrokes = implode(' or ', $keystrokes); - $rows[] = - ''. - 'Really delete the query "'.phutil_escape_html($name).'"? '. - 'It will be lost forever!'. - '
') + ->appendChild(hsprintf( + 'Really delete the query "%s"? It will be lost forever!
', + $name)) ->addCancelButton('/maniphest/custom/') ->addSubmitButton('Delete'); diff --git a/src/applications/owners/controller/PhabricatorOwnersDeleteController.php b/src/applications/owners/controller/PhabricatorOwnersDeleteController.php index 4aa31e8d51..8e45a4c98e 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDeleteController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDeleteController.php @@ -27,10 +27,10 @@ final class PhabricatorOwnersDeleteController $dialog = id(new AphrontDialogView()) ->setUser($user) ->setTitle('Really delete this package?') - ->appendChild( - 'Are you sure you want to delete the "'. - phutil_escape_html($package->getName()).'" package? This operation '. - 'can not be undone.
') + ->appendChild(hsprintf( + 'Are you sure you want to delete the "%s" package? This operation '. + 'can not be undone.
', + $package->getName())) ->addSubmitButton('Delete') ->addCancelButton('/owners/package/'.$package->getID().'/') ->setSubmitURI($request->getRequestURI()); diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php index fe07e5767d..58afadf36d 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php @@ -92,8 +92,7 @@ final class PhabricatorOwnersDetailController 'path' => $path->getPath(), 'action' => 'browse' )); - $repo_name = ''.phutil_escape_html($repo->getName()). - ''; + $repo_name = phutil_tag('strong', array(), $repo->getName()); $path_link = phutil_tag( 'a', array( diff --git a/src/applications/owners/controller/PhabricatorOwnersListController.php b/src/applications/owners/controller/PhabricatorOwnersListController.php index c23ed1eb5f..9a140620b1 100644 --- a/src/applications/owners/controller/PhabricatorOwnersListController.php +++ b/src/applications/owners/controller/PhabricatorOwnersListController.php @@ -253,7 +253,7 @@ final class PhabricatorOwnersListController )); $pkg_paths[$key] = ($path->getExcluded() ? '–' : '+').' '. - ''.phutil_escape_html($repo->getName()).' '. + phutil_tag('strong', array(), $repo->getName()). phutil_tag( 'a', array( diff --git a/src/applications/people/controller/PhabricatorPeopleProfileController.php b/src/applications/people/controller/PhabricatorPeopleProfileController.php index f88c7dfa0e..d16f5d948e 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfileController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfileController.php @@ -182,36 +182,36 @@ final class PhabricatorPeopleProfileController $viewer = $this->getRequest()->getUser(); - $content = + $content = hsprintf( '| PHID | -'.phutil_escape_html($user->getPHID()).' | +%s |
|---|---|---|
| User Since | -'.phabricator_datetime($user->getDateCreated(), - $viewer). - ' | +%s |
| Blurb | -'.$blurb.' | +%s |
|---|
| Creator | -'.$handles[$project->getAuthorPHID()]->renderLink().' | +%s |
|---|---|---|
| Created | -'.$timestamp.' | +%s |
| PHID | -'.phutil_escape_html($project->getPHID()).' | +%s |
| Blurb | -'.$blurb.' | +%s |
Really delete the "'.phutil_escape_html($arc_project->getName()). - '" arcanist project? '. - 'This operation can not be undone.
') + ->appendChild(hsprintf( + 'Really delete the "%s" arcanist project? '. + 'This operation can not be undone.
', + $arc_project->getName())) ->setSubmitURI('/repository/project/delete/'.$this->id.'/') ->addSubmitButton('Delete Arcanist Project') ->addCancelButton('/repository/'); diff --git a/src/applications/repository/controller/PhabricatorRepositoryDeleteController.php b/src/applications/repository/controller/PhabricatorRepositoryDeleteController.php index da47f4304d..4e89e68839 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryDeleteController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryDeleteController.php @@ -24,8 +24,7 @@ final class PhabricatorRepositoryDeleteController $dialog = new AphrontDialogView(); $text_1 = pht('If you really want to delete the repository, you must run:'); - $command = 'bin/repository delete '. - phutil_escape_html($repository->getCallsign()); + $command = 'bin/repository delete '.$repository->getCallsign(); $text_2 = pht('Repositories touch many objects and as such deletes are '. 'prohibitively expensive to run from the web UI.'); $body = phutil_tag( diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php index 9ad348ed6b..86a0d10dbc 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php @@ -301,9 +301,9 @@ final class PhabricatorSettingsPanelEmailAddresses ->setUser($user) ->addHiddenInput('verify', $email_id) ->setTitle("Send Another Verification Email?") - ->appendChild( - 'Send another copy of the verification email to '. - phutil_escape_html($address).'?
') + ->appendChild(hsprintf( + 'Send another copy of the verification email to %s?
', + $address)) ->addSubmitButton('Send Email') ->addCancelButton($uri); @@ -342,9 +342,10 @@ final class PhabricatorSettingsPanelEmailAddresses ->setUser($user) ->addHiddenInput('primary', $email_id) ->setTitle("Change primary email address?") - ->appendChild( + ->appendChild(hsprintf( 'If you change your primary address, Phabricator will send all '. - 'email to '.phutil_escape_html($address).'.
') + 'email to %s.', + $address)) ->addSubmitButton('Change Primary Address') ->addCancelButton($uri); diff --git a/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php b/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php index 4da5cb002a..f386982964 100644 --- a/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php +++ b/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php @@ -43,16 +43,14 @@ final class PhabricatorUIExampleRenderController extends PhabricatorController { require_celerity_resource('phabricator-ui-example-css'); - $nav->appendChild( + $nav->appendChild(hsprintf( '' - .$example->getDescription(). - '
'. - '%s
'. + '', + $example->getName(), + get_class($example), + $example->getDescription())); $nav->appendChild($result); diff --git a/src/applications/uiexample/examples/PhabricatorActionListExample.php b/src/applications/uiexample/examples/PhabricatorActionListExample.php index 44f6e01791..33df2496b5 100644 --- a/src/applications/uiexample/examples/PhabricatorActionListExample.php +++ b/src/applications/uiexample/examples/PhabricatorActionListExample.php @@ -7,7 +7,8 @@ final class PhabricatorActionListExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use PhabricatorActionListView to render object actions.'; + return hsprintf( + 'Use PhabricatorActionListView to render object actions.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorButtonsExample.php b/src/applications/uiexample/examples/PhabricatorButtonsExample.php index d234bc2308..0a3e57f715 100644 --- a/src/applications/uiexample/examples/PhabricatorButtonsExample.php +++ b/src/applications/uiexample/examples/PhabricatorButtonsExample.php @@ -7,7 +7,7 @@ final class PhabricatorButtonsExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use <button> to render buttons.'; + return hsprintf('Use <button> to render buttons.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorErrorExample.php b/src/applications/uiexample/examples/PhabricatorErrorExample.php index 5f1a1a5cfb..b021c6f7fd 100644 --- a/src/applications/uiexample/examples/PhabricatorErrorExample.php +++ b/src/applications/uiexample/examples/PhabricatorErrorExample.php @@ -7,8 +7,8 @@ final class PhabricatorErrorExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use AphrontErrorView to render errors, warnings and '. - 'notices.'; + return hsprintf( + 'Use AphrontErrorView to render errors, warnings and notices.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorFormExample.php b/src/applications/uiexample/examples/PhabricatorFormExample.php index c045766fa7..ac65b37cd4 100644 --- a/src/applications/uiexample/examples/PhabricatorFormExample.php +++ b/src/applications/uiexample/examples/PhabricatorFormExample.php @@ -7,7 +7,7 @@ final class PhabricatorFormExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use AphrontFormView to render forms.'; + return hsprintf('Use AphrontFormView to render forms.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorPropertyListExample.php b/src/applications/uiexample/examples/PhabricatorPropertyListExample.php index 9ac216d82b..58b751830d 100644 --- a/src/applications/uiexample/examples/PhabricatorPropertyListExample.php +++ b/src/applications/uiexample/examples/PhabricatorPropertyListExample.php @@ -7,8 +7,8 @@ final class PhabricatorPropertyListExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use PhabricatorPropertyListView to render object '. - 'properties.'; + return hsprintf( + 'Use PhabricatorPropertyListView to render object properties.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorTagExample.php b/src/applications/uiexample/examples/PhabricatorTagExample.php index 4461ee11e8..e70a4f3a34 100644 --- a/src/applications/uiexample/examples/PhabricatorTagExample.php +++ b/src/applications/uiexample/examples/PhabricatorTagExample.php @@ -7,7 +7,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use PhabricatorTagView to render various tags.'; + return hsprintf('Use PhabricatorTagView to render various tags.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorTimelineExample.php b/src/applications/uiexample/examples/PhabricatorTimelineExample.php index 68e6878999..ced405e78c 100644 --- a/src/applications/uiexample/examples/PhabricatorTimelineExample.php +++ b/src/applications/uiexample/examples/PhabricatorTimelineExample.php @@ -7,7 +7,8 @@ final class PhabricatorTimelineExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use PhabricatorTimelineView to comments and transactions.'; + return hsprintf( + 'Use PhabricatorTimelineView to comments and transactions.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorUIListFilterExample.php b/src/applications/uiexample/examples/PhabricatorUIListFilterExample.php index 2ca377965a..81ce37b04c 100644 --- a/src/applications/uiexample/examples/PhabricatorUIListFilterExample.php +++ b/src/applications/uiexample/examples/PhabricatorUIListFilterExample.php @@ -7,8 +7,9 @@ final class PhabricatorUIListFilterExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use AphrontListFilterView to layout controls for '. - 'filtering and manipulating lists of objects.'; + return hsprintf( + 'Use AphrontListFilterView to layout controls for filtering '. + 'and manipulating lists of objects.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorUINotificationExample.php b/src/applications/uiexample/examples/PhabricatorUINotificationExample.php index 031bb42c30..429f6c1a12 100644 --- a/src/applications/uiexample/examples/PhabricatorUINotificationExample.php +++ b/src/applications/uiexample/examples/PhabricatorUINotificationExample.php @@ -7,7 +7,7 @@ final class PhabricatorUINotificationExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use JX.Notification to create notifications.'; + return hsprintf('Use JX.Notification to create notifications.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorUIPagerExample.php b/src/applications/uiexample/examples/PhabricatorUIPagerExample.php index aabacecd90..f50a335547 100644 --- a/src/applications/uiexample/examples/PhabricatorUIPagerExample.php +++ b/src/applications/uiexample/examples/PhabricatorUIPagerExample.php @@ -7,8 +7,9 @@ final class PhabricatorUIPagerExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use AphrontPagerView to create a control which allows '. - 'users to paginate through large amounts of content.'; + return hsprintf( + 'Use AphrontPagerView to create a control which allows '. + 'users to paginate through large amounts of content.'); } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorUITooltipExample.php b/src/applications/uiexample/examples/PhabricatorUITooltipExample.php index 9f806e3516..178b16beb9 100644 --- a/src/applications/uiexample/examples/PhabricatorUITooltipExample.php +++ b/src/applications/uiexample/examples/PhabricatorUITooltipExample.php @@ -7,7 +7,7 @@ final class PhabricatorUITooltipExample extends PhabricatorUIExample { } public function getDescription() { - return 'Use JX.Tooltip to create tooltips.'; + return hsprintf('Use JX.Tooltip to create tooltips.'); } public function renderExample() { diff --git a/src/infrastructure/diff/view/PhabricatorInlineSummaryView.php b/src/infrastructure/diff/view/PhabricatorInlineSummaryView.php index 2fa90c9f01..de792665fb 100644 --- a/src/infrastructure/diff/view/PhabricatorInlineSummaryView.php +++ b/src/infrastructure/diff/view/PhabricatorInlineSummaryView.php @@ -39,12 +39,7 @@ final class PhabricatorInlineSummaryView extends AphrontView { } } - $rows[] = - '| '. - phutil_escape_html($this->profileName). - ' | -'. - self::renderSingleView($this->profileActions). - ' | -'. - $image. - ' | +%s | +%s | +%s |
| '. - $description. - ' | +%s |
9{io*F>X1PZs5*K$IF;n6R
zSt{higM%(it}44214Wt}UAuL@c!oS_>Sbn^_bUkqVQ|+M=n>Iyn3*||L0p+XkmJV+
z26pgdVPl?>O5Qm&4yJ=b?&h<4I4r6a`=2*VJUh>kscABcS-PG0odEWg4c*NQc^2G8
g8u8wXHP&o1QF+jKYij{JXi7CaPl3T2v;+o>0om@^-v9sr
literal 0
HcmV?d00001
diff --git a/webroot/rsrc/js/application/core/behavior-dark-console-ajax.js b/webroot/rsrc/js/application/core/behavior-dark-console-ajax.js
deleted file mode 100644
index ecaa6053cc..0000000000
--- a/webroot/rsrc/js/application/core/behavior-dark-console-ajax.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * @provides javelin-behavior-dark-console-ajax
- * @requires javelin-behavior
- * javelin-dom
- */
-
-JX.behavior('dark-console-ajax', function(config) {
- var requestLog = JX.DOM.find(document.body,
- 'table',
- 'dark-console-request-log');
- var requestTable = JX.DOM.find(requestLog, 'table');
- var requestRows = JX.DOM.scry(requestTable, 'tr');
- var requestNumber = requestRows.length - 1; // header don't count
- var requestURI = config.uri;
- var console = JX.$H(config.console);
- var newRowType = 'ajax';
-
- var newRowNumber = JX.$N(
- 'a',
- {
- 'sigil' : 'request-log-number',
- 'meta' : { 'console' : console }
- },
- requestNumber
- );
- var newRowURI = JX.$N(
- 'a',
- {
- 'sigil' : 'request-log-uri',
- 'meta' : { 'console' : console }
- },
- requestURI
- );
-
- var newRow = JX.$N(
- 'tr',
- {
- 'className' : requestNumber % 2 ? 'alt' : ''
- },
- [
- JX.$N('td', {}, newRowNumber),
- JX.$N('td', {}, newRowType),
- JX.$N('td', {}, newRowURI)
- ]
- );
-
- JX.DOM.appendContent(requestTable, newRow);
-
-});
diff --git a/webroot/rsrc/js/application/core/behavior-dark-console.js b/webroot/rsrc/js/application/core/behavior-dark-console.js
index 3f31ac1545..0c72d0469c 100644
--- a/webroot/rsrc/js/application/core/behavior-dark-console.js
+++ b/webroot/rsrc/js/application/core/behavior-dark-console.js
@@ -6,55 +6,221 @@
* javelin-dom
* javelin-request
* phabricator-keyboard-shortcut
- * javelin-behavior-dark-console-ajax
*/
-JX.behavior('dark-console', function(config) {
- var selected_tab = null;
-
- JX.Stratcom.listen(
- 'click',
- ['dark-console', 'dark-console-tab'],
- function(e) {
- var console = e.getNode('dark-console');
- var tabs = JX.DOM.scry(console, 'a', 'dark-console-tab');
- var panels = JX.DOM.scry(console, 'div', 'dark-console-panel');
- var target = e.getTarget();
- for (var ii = 0; ii < tabs.length; ii++) {
- JX.DOM.alterClass(
- tabs[ii],
- 'dark-console-tab-selected',
- tabs[ii] == target);
- (tabs[ii] != target ? JX.DOM.hide : JX.DOM.show)(panels[ii]);
+JX.behavior('dark-console', function(config, statics) {
+ var root = statics.root || setup_console();
+
+ config.key = config.key || root.getAttribute('data-console-key');
+ add_request(config);
+
+
+ // Do first-time setup.
+ function setup_console() {
+ statics.root = JX.$('darkconsole');
+ statics.req = {all: {}, current: null};
+ statics.tab = {all: {}, current: null};
+
+ statics.el = {};
+
+ statics.el.reqs = JX.$N('div', {className: 'dark-console-requests'});
+ statics.root.appendChild(statics.el.reqs);
+
+ statics.el.tabs = JX.$N('div', {className: 'dark-console-tabs'});
+ statics.root.appendChild(statics.el.tabs);
+
+ statics.el.panel = JX.$N('div', {className: 'dark-console-panel'});
+ statics.root.appendChild(statics.el.panel);
+
+ statics.el.load = JX.$N('div', {className: 'dark-console-load'});
+ statics.root.appendChild(statics.el.load);
+
+ statics.cache = {};
+
+ statics.visible = config.visible;
+ statics.selected = config.selected;
+
+ return statics.root;
+ }
+
+
+ // Add a new request to the console (initial page load, or new Ajax response).
+ function add_request(config) {
+
+ // Ignore DarkConsole data requests.
+ if (config.uri.match(new RegExp('^/~/data/'))) {
+ return;
+ }
+
+ var attr = {
+ className: 'dark-console-request',
+ sigil: 'dark-console-request',
+ title: config.uri,
+ meta: config,
+ href: '#'
+ };
+
+ var link = JX.$N('a', attr, config.uri);
+ statics.el.reqs.appendChild(link);
+ statics.req.all[config.key] = link;
+
+ if (!statics.req.current) {
+ select_request(config.key);
+ }
+ }
+
+
+ // Select a request (on load, or when the user clicks one).
+ function select_request(key) {
+ var req = statics.req;
+
+ if (req.current) {
+ JX.DOM.alterClass(req.all[req.current], 'dark-selected', false);
+ }
+ statics.req.current = key;
+ JX.DOM.alterClass(req.all[req.current], 'dark-selected', true);
+
+ if (statics.visible) {
+ JX.log('visible!');
+ draw_request(key);
+ }
+ }
+
+ // When the user clicks a request, select it.
+ JX.Stratcom.listen('click', 'dark-console-request', function(e) {
+ e.kill();
+ select_request(e.getNodeData('dark-console-request').key);
+ });
+
+
+ // After the user selects a request, draw its tabs.
+ function draw_request(key) {
+ var cache = statics.cache;
+
+ if (cache[key]) {
+ render_request(key);
+ return;
+ }
+
+ new JX.Request(
+ '/~/data/' + key + '/',
+ function(r) {
+ cache[key] = r;
+ if (statics.req.current == key) {
+ render_request(key);
+ }
+ })
+ .send();
+
+ show_loading();
+ }
+
+ // Show the loading indicator.
+ function show_loading() {
+ JX.DOM.hide(statics.el.tabs);
+ JX.DOM.hide(statics.el.panel);
+ JX.DOM.show(statics.el.load);
+ }
+
+ // Hide the loading indicator.
+ function hide_loading() {
+ JX.DOM.show(statics.el.tabs);
+ JX.DOM.show(statics.el.panel);
+ JX.DOM.hide(statics.el.load);
+ }
+
+ function render_request(key) {
+ var data = statics.cache[key];
+
+ statics.tab.all = {};
+
+ var links = [];
+ var first = null;
+ for (var ii = 0; ii < data.tabs.length; ii++) {
+ var tab = data.tabs[ii];
+ var attr = {
+ className: 'dark-console-tab',
+ sigil: 'dark-console-tab',
+ meta: tab,
+ href: '#'
+ };
+
+ var bullet = null;
+ if (tab.color) {
+ bullet = JX.$N('span', {style: {color: tab.color}}, "\u2022");
}
- selected_tab = target.id.replace('dark-console-tab-', '');
+ var link = JX.$N('a', attr, [bullet, ' ', tab.name]);
+ links.push(link);
+ statics.tab.all[tab['class']] = link;
+ first = first || tab['class'];
+ }
+
+ JX.DOM.setContent(statics.el.tabs, links);
+
+ if (statics.tab.current in statics.tab.all) {
+ select_tab(statics.tab.current);
+ } else if (statics.selected in statics.tab.all) {
+ select_tab(statics.selected);
+ } else {
+ select_tab(first);
+ }
+
+ hide_loading();
+ }
+
+ function select_tab(tclass) {
+ var tabs = statics.tab;
+
+ if (tabs.current) {
+ JX.DOM.alterClass(tabs.current, 'dark-selected', false);
+ }
+ tabs.current = tabs.all[tclass];
+ JX.DOM.alterClass(tabs.current, 'dark-selected', true);
- new JX.Request(config.uri, JX.bag)
- .setData({ tab : selected_tab })
+ if (tclass != statics.selected) {
+ // Save user preference.
+ new JX.Request('/~/', JX.bag)
+ .setData({ tab : tclass })
.send();
- });
+ }
+
+ draw_panel();
+ }
+
+ // When the user clicks a tab, select it.
+ JX.Stratcom.listen('click', 'dark-console-tab', function(e) {
+ e.kill();
+ select_tab(e.getNodeData('dark-console-tab')['class']);
+ });
+ function draw_panel() {
+ var data = statics.cache[statics.req.current];
+ var tclass = JX.Stratcom.getData(statics.tab.current)['class'];
+ var html = data.panel[tclass];
+
+ var div = JX.$N('div', {className: 'dark-console-panel-core'}, JX.$H(html));
+ JX.DOM.setContent(statics.el.panel, div);
+ }
+
+ // Install keyboard shortcut.
var desc = 'Toggle visibility of DarkConsole.';
new JX.KeyboardShortcut('`', desc)
.setHandler(function(manager) {
- var console = JX.DOM.find(document.body, 'table', 'dark-console');
- var requestLog = JX.DOM.find(
- document.body,
- 'table',
- 'dark-console-request-log');
-
- config.visible = !config.visible;
- if (config.visible) {
- JX.DOM.show(console);
- JX.DOM.show(requestLog);
+ statics.visible = !statics.visible;
+
+ if (statics.visible) {
+ JX.DOM.show(root);
+ if (statics.req.current) {
+ draw_request(statics.req.current);
+ }
} else {
- JX.DOM.hide(console);
- JX.DOM.hide(requestLog);
+ JX.DOM.hide(root);
}
- new JX.Request(config.uri, JX.bag)
- .setData({visible: config.visible ? 1 : 0})
+ // Save user preference.
+ new JX.Request('/~/', JX.bag)
+ .setData({visible: statics.visible ? 1 : 0})
.send();
// Force resize listeners to take effect.
@@ -62,89 +228,4 @@ JX.behavior('dark-console', function(config) {
})
.register();
- var initRequestLog = function() {
- var console = JX.DOM.find(document.body,
- 'table',
- 'dark-console');
- var requestLog = JX.DOM.find(document.body,
- 'table',
- 'dark-console-request-log');
- var requestTable = JX.DOM.find(requestLog, 'table');
- var rows = JX.DOM.scry(requestTable, 'tr');
- var tableHeader = rows[0];
- var newRowNumber = JX.$N(
- 'a',
- {
- 'sigil' : 'request-log-number',
- 'meta' : { 'console' : console }
- },
- "0"
- );
- var newRowURI = JX.$N(
- 'a',
- {
- 'sigil' : 'request-log-uri',
- 'meta' : { 'console' : console }
- },
- config.request_uri
- );
-
- var newRow = JX.$N(
- 'tr',
- {
- 'className' : 'highlight'
- },
- [
- JX.$N('td', {}, newRowNumber),
- JX.$N('td', {}, 'main'),
- JX.$N('td', {}, newRowURI)
- ]
- );
-
- JX.DOM.setContent(requestTable, [tableHeader, newRow]);
- }
-
- initRequestLog();
-
- var updateActiveRequest = function(e) {
- var log = e.getNode('dark-console-request-log');
- var table = JX.DOM.find(log, 'table');
- var rows = JX.DOM.scry(table, 'tr');
- var targetRow = e.getTarget().parentNode.parentNode;
- var data = JX.Stratcom.getData(e.getTarget());
- var newConsole = data.console;
- for (var ii = 0; ii < rows.length; ii++) {
- JX.DOM.alterClass(
- rows[ii],
- 'highlight',
- rows[ii] == targetRow);
- }
- var console = JX.DOM.find(document.body, 'table', 'dark-console');
- JX.DOM.replace(console, newConsole);
- if (selected_tab) {
- console = JX.DOM.find(document.body, 'table', 'dark-console');
- var s_id = 'dark-console-tab-' + selected_tab;
- var tabs = JX.DOM.scry(console, 'a', 'dark-console-tab');
- var panels = JX.DOM.scry(console, 'div', 'dark-console-panel');
- for (var ii = 0; ii < tabs.length; ii++) {
- JX.DOM.alterClass(
- tabs[ii],
- 'dark-console-tab-selected',
- tabs[ii].id == s_id);
- (tabs[ii].id != s_id ? JX.DOM.hide : JX.DOM.show)(panels[ii]);
- }
- }
- }
-
- JX.Stratcom.listen(
- 'click',
- ['dark-console-request-log', 'request-log-number'],
- updateActiveRequest
- );
- JX.Stratcom.listen(
- 'click',
- ['dark-console-request-log', 'request-log-uri'],
- updateActiveRequest
- );
-
});
--
2.51.2
From da27b448fa318ce145000e266168d708fb06dcb0 Mon Sep 17 00:00:00 2001
From: epriestley
Date: Mon, 28 Jan 2013 18:46:04 -0800
Subject: [PATCH 22/50] render_tag -> tag: DifferentialResultsTableView
Summary: Fix lint and unit results escaping.
Test Plan:
Looked at lint/unit results. Clicked show/hide:
{F30680}
Reviewers: vrana
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2432
Differential Revision: https://secure.phabricator.com/D4693
---
.../DifferentialLintFieldSpecification.php | 15 ++++++++-----
.../DifferentialUnitFieldSpecification.php | 6 ++---
.../view/DifferentialResultsTableView.php | 22 +++++++++----------
3 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php b/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
index 2c0164a255..b773e38580 100644
--- a/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
@@ -43,7 +43,7 @@ final class DifferentialLintFieldSpecification
$rows[] = array(
'style' => 'star',
- 'name' => $lstar,
+ 'name' => phutil_safe_html($lstar),
'value' => $lmsg,
'show' => true,
);
@@ -53,7 +53,7 @@ final class DifferentialLintFieldSpecification
$rows[] = array(
'style' => 'excuse',
'name' => 'Excuse',
- 'value' => nl2br(phutil_escape_html($excuse)),
+ 'value' => phutil_safe_html(nl2br(phutil_escape_html($excuse))),
'show' => true,
);
}
@@ -67,7 +67,7 @@ final class DifferentialLintFieldSpecification
$rows[] = array(
'style' => 'section',
- 'name' => phutil_escape_html($path),
+ 'name' => $path,
'show' => $show_limit,
);
@@ -108,7 +108,7 @@ final class DifferentialLintFieldSpecification
$rows[] = array(
'style' => $this->getSeverityStyle($severity),
- 'name' => phutil_escape_html(ucwords($severity)),
+ 'name' => ucwords($severity),
'value' => hsprintf(
"(%s) %s at {$line_link}",
$code,
@@ -130,7 +130,10 @@ final class DifferentialLintFieldSpecification
if (strlen($description)) {
$rows[] = array(
'style' => 'details',
- 'value' => nl2br(phutil_escape_html($description)),
+ 'value' =>
+ phutil_safe_html(
+ nl2br(
+ phutil_escape_html($description))),
'show' => false,
);
if (empty($hidden['details'])) {
@@ -148,7 +151,7 @@ final class DifferentialLintFieldSpecification
$rows[] = array(
'style' => $this->getPostponedStyle(),
'name' => 'Postponed',
- 'value' => phutil_escape_html($linter),
+ 'value' => $linter,
'show' => false,
);
if (empty($hidden['postponed'])) {
diff --git a/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php b/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
index 348964045c..b19ae2f798 100644
--- a/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
@@ -37,7 +37,7 @@ final class DifferentialUnitFieldSpecification
$rows[] = array(
'style' => 'star',
- 'name' => $ustar,
+ 'name' => phutil_safe_html($ustar),
'value' => $umsg,
'show' => true,
);
@@ -47,7 +47,7 @@ final class DifferentialUnitFieldSpecification
$rows[] = array(
'style' => 'excuse',
'name' => 'Excuse',
- 'value' => nl2br(phutil_escape_html($excuse)),
+ 'value' => phutil_safe_html(nl2br(phutil_escape_html($excuse))),
'show' => true,
);
}
@@ -105,7 +105,7 @@ final class DifferentialUnitFieldSpecification
}
$rows[] = array(
'style' => $this->getResultStyle($result),
- 'name' => phutil_escape_html(ucwords($result)),
+ 'name' => ucwords($result),
'value' => $value,
'show' => $show,
);
diff --git a/src/applications/differential/view/DifferentialResultsTableView.php b/src/applications/differential/view/DifferentialResultsTableView.php
index 46c8595968..519c9319f1 100644
--- a/src/applications/differential/view/DifferentialResultsTableView.php
+++ b/src/applications/differential/view/DifferentialResultsTableView.php
@@ -25,7 +25,7 @@ final class DifferentialResultsTableView extends AphrontView {
$style = idx($row, 'style');
switch ($style) {
case 'section':
- $cells = phutil_render_tag(
+ $cells = phutil_tag(
'th',
array(
'colspan' => 2,
@@ -33,23 +33,23 @@ final class DifferentialResultsTableView extends AphrontView {
idx($row, 'name'));
break;
default:
- $name = phutil_render_tag(
+ $name = phutil_tag(
'th',
array(
),
idx($row, 'name'));
- $value = phutil_render_tag(
+ $value = phutil_tag(
'td',
array(
),
idx($row, 'value'));
- $cells = $name.$value;
+ $cells = array($name, $value);
break;
}
$show = idx($row, 'show');
- $rows[] = javelin_render_tag(
+ $rows[] = javelin_tag(
'tr',
array(
'style' => $show ? null : 'display: none',
@@ -64,7 +64,7 @@ final class DifferentialResultsTableView extends AphrontView {
}
if ($any_hidden) {
- $show_more = javelin_render_tag(
+ $show_more = javelin_tag(
'a',
array(
'href' => '#',
@@ -72,7 +72,7 @@ final class DifferentialResultsTableView extends AphrontView {
),
$this->showMoreString);
- $hide_more = javelin_render_tag(
+ $hide_more = javelin_tag(
'a',
array(
'href' => '#',
@@ -80,22 +80,22 @@ final class DifferentialResultsTableView extends AphrontView {
),
'Hide');
- $rows[] = javelin_render_tag(
+ $rows[] = javelin_tag(
'tr',
array(
'class' => 'differential-results-row-show',
'sigil' => 'differential-results-row-show',
),
- ''.$show_more.'