Skip to content

Commit 48561a8

Browse files
author
vrana
committed
Convert phutil_render_tag(X, Y, phutil_escape_html(Z)) to phutil_tag
Summary: Created with spatch: lang=diff - phutil_render_tag + phutil_tag (X, Y, - phutil_escape_html( Z - ) ) Test Plan: Loaded homepage Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4501
1 parent f8dbfdd commit 48561a8

File tree

84 files changed

+225
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+225
-231
lines changed

src/aphront/configuration/AphrontDefaultApplicationConfiguration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,17 @@ private function renderStackTrace($trace, PhabricatorUser $user) {
333333
'$'.$part['line'];
334334
$attrs['target'] = '_blank';
335335
}
336-
$file_name = phutil_render_tag(
336+
$file_name = phutil_tag(
337337
'a',
338338
$attrs,
339-
phutil_escape_html($relative));
339+
$relative);
340340
} else {
341-
$file_name = phutil_render_tag(
341+
$file_name = phutil_tag(
342342
'span',
343343
array(
344344
'title' => $file,
345345
),
346-
phutil_escape_html($relative));
346+
$relative);
347347
}
348348
$file_name = $file_name.' : '.(int)$part['line'];
349349
} else {

src/aphront/console/plugin/DarkConsoleErrorLogPlugin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ public function render() {
3939
$file = $row['file'];
4040
$line = $row['line'];
4141

42-
$tag = phutil_render_tag(
42+
$tag = phutil_tag(
4343
'a',
4444
array(
4545
'onclick' => jsprintf('show_details(%d)', $index),
4646
),
47-
phutil_escape_html($row['str'].' at ['.basename($file).':'.$line.']'));
47+
$row['str'].' at ['.basename($file).':'.$line.']');
4848
$rows[] = array($tag);
4949

5050
$details .=
@@ -70,12 +70,12 @@ public function render() {
7070
}
7171
}
7272

73-
$details .= phutil_render_tag(
73+
$details .= phutil_tag(
7474
'a',
7575
array(
7676
'href' => $href,
7777
),
78-
phutil_escape_html($line));
78+
$line);
7979
$details .= "\n";
8080
}
8181

src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ public function processRequest() {
1616
foreach ($channels as $channel) {
1717
$name = $channel['channel'];
1818
$rows[] = array(
19-
phutil_render_tag(
19+
phutil_tag(
2020
'a',
2121
array(
2222
'href' => '/chatlog/channel/'.phutil_escape_uri($name).'/',
2323
),
24-
phutil_escape_html($name)));
24+
$name));
2525
}
2626

2727
$table = new AphrontTableView($rows);

src/applications/conduit/controller/PhabricatorConduitListController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public function processRequest() {
2525

2626
$rows[] = array(
2727
$group,
28-
phutil_render_tag(
28+
phutil_tag(
2929
'a',
3030
array(
3131
'href' => '/conduit/method/'.$info['full_name'],
3232
),
33-
phutil_escape_html($info['full_name'])),
33+
$info['full_name']),
3434
$info['description'],
3535
$status,
3636
);

src/applications/config/controller/PhabricatorConfigAllController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public function processRequest() {
2424
}
2525

2626
$rows[] = array(
27-
phutil_render_tag(
27+
phutil_tag(
2828
'a',
2929
array(
3030
'href' => $this->getApplicationURI('edit/'.$key.'/'),
3131
),
32-
phutil_escape_html($key)),
32+
$key),
3333
$value,
3434
);
3535
}

src/applications/config/view/PhabricatorSetupIssueView.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ public function render() {
9595
),
9696
pht('To continue, resolve this problem and reload the page.'));
9797

98-
$name = phutil_render_tag(
98+
$name = phutil_tag(
9999
'div',
100100
array(
101101
'class' => 'setup-issue-name',
102102
),
103-
phutil_escape_html($issue->getName()));
103+
$issue->getName());
104104

105105
return phutil_render_tag(
106106
'div',
@@ -283,10 +283,10 @@ private function renderPHPConfig(array $configs) {
283283
"To update these %d value(s), edit your PHP configuration file, ".
284284
"located here:",
285285
count($configs)));
286-
$info .= phutil_render_tag(
286+
$info .= phutil_tag(
287287
'pre',
288288
array(),
289-
phutil_escape_html($ini_loc));
289+
$ini_loc);
290290
}
291291

292292
if ($more_loc) {
@@ -296,10 +296,10 @@ private function renderPHPConfig(array $configs) {
296296
pht(
297297
"PHP also loaded these configuration file(s):",
298298
count($more_loc)));
299-
$info .= phutil_render_tag(
299+
$info .= phutil_tag(
300300
'pre',
301301
array(),
302-
phutil_escape_html(implode("\n", $more_loc)));
302+
implode("\n", $more_loc));
303303
}
304304

305305
$info .= phutil_render_tag(

src/applications/countdown/controller/PhabricatorCountdownListController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public function processRequest() {
4848
$rows[] = array(
4949
phutil_escape_html($timer->getID()),
5050
$handles[$timer->getAuthorPHID()]->renderLink(),
51-
phutil_render_tag(
51+
phutil_tag(
5252
'a',
5353
array(
5454
'href' => '/countdown/'.$timer->getID().'/',
5555
),
56-
phutil_escape_html($timer->getTitle())),
56+
$timer->getTitle()),
5757
phabricator_datetime($timer->getDatepoint(), $user),
5858
$edit_button,
5959
$delete_button,

src/applications/daemon/view/PhabricatorDaemonLogEventsView.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ public function render() {
6969
if ($this->combinedLog) {
7070
array_unshift(
7171
$row,
72-
phutil_render_tag(
72+
phutil_tag(
7373
'a',
7474
array(
7575
'href' => '/daemon/log/'.$event->getLogID().'/',
7676
),
77-
phutil_escape_html('Daemon '.$event->getLogID())));
77+
'Daemon '.$event->getLogID()));
7878
}
7979

8080
$rows[] = $row;

src/applications/differential/controller/DifferentialDiffViewController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public function processRequest() {
1919
if ($diff->getRevisionID()) {
2020
$top_panel = new AphrontPanelView();
2121
$top_panel->setWidth(AphrontPanelView::WIDTH_WIDE);
22-
$link = phutil_render_tag(
22+
$link = phutil_tag(
2323
'a',
2424
array(
2525
'href' => PhabricatorEnv::getURI('/D'.$diff->getRevisionID()),
2626
),
27-
phutil_escape_html('D'.$diff->getRevisionID()));
27+
'D'.$diff->getRevisionID());
2828
$top_panel->appendChild(
2929
"<h1>".pht('This diff belongs to revision %s', $link)."</h1>");
3030
} else {
@@ -52,12 +52,12 @@ public function processRequest() {
5252
if ($revisions) {
5353
$select[] = '<optgroup label="'.pht('Update Existing Revision').'">';
5454
foreach ($revisions as $revision) {
55-
$select[] = phutil_render_tag(
55+
$select[] = phutil_tag(
5656
'option',
5757
array(
5858
'value' => $revision->getID(),
5959
),
60-
phutil_escape_html($revision->getTitle()));
60+
$revision->getTitle());
6161
}
6262
$select[] = '</optgroup>';
6363
}

src/applications/differential/field/specification/DifferentialTitleFieldSpecification.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ public function getColumnClassForRevisionList() {
8787
}
8888

8989
public function renderValueForRevisionList(DifferentialRevision $revision) {
90-
return phutil_render_tag(
90+
return phutil_tag(
9191
'a',
9292
array(
9393
'href' => '/D'.$revision->getID(),
9494
),
95-
phutil_escape_html($revision->getTitle()));
95+
$revision->getTitle());
9696
}
9797

9898
}

src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ public function build(array $changesets) {
9797
),
9898
'');
9999

100-
$name_element = phutil_render_tag(
100+
$name_element = phutil_tag(
101101
'span',
102102
array(
103103
'class' => 'phabricator-filetree-name',
104104
),
105-
phutil_escape_html($name));
105+
$name);
106106

107107
$filetree[] = javelin_render_tag(
108108
$href ? 'a' : 'span',

src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ public function render() {
145145
}
146146
$last_base = $base;
147147

148-
$id_link = phutil_render_tag(
148+
$id_link = phutil_tag(
149149
'a',
150150
array('href' => '/differential/diff/'.$id.'/'),
151-
phutil_escape_html($id));
151+
$id);
152152
$rows[] =
153153
'<tr'.$class.'>'.
154154
'<td class="revhistory-name">'.phutil_escape_html($name).'</td>'.
@@ -179,15 +179,15 @@ public function render() {
179179

180180
$select = '<select name="whitespace">';
181181
foreach ($options as $value => $label) {
182-
$select .= phutil_render_tag(
182+
$select .= phutil_tag(
183183
'option',
184184
array(
185185
'value' => $value,
186186
'selected' => ($value == $this->selectedWhitespace)
187187
? 'selected'
188188
: null,
189189
),
190-
phutil_escape_html($label));
190+
$label);
191191
}
192192
$select .= '</select>';
193193

src/applications/diffusion/controller/DiffusionBrowseFileController.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ private function buildCorpus($selected,
178178
case 'plain':
179179
$style =
180180
"margin: 1em 2em; width: 90%; height: 80em; font-family: monospace";
181-
$corpus = phutil_render_tag(
181+
$corpus = phutil_tag(
182182
'textarea',
183183
array(
184184
'style' => $style,
185185
),
186-
phutil_escape_html($file_query->getRawData()));
186+
$file_query->getRawData());
187187

188188
break;
189189

@@ -205,12 +205,12 @@ private function buildCorpus($selected,
205205
sprintf("%-10s %-20s %s", substr($rev, 0, 7), $author, $line);
206206
}
207207

208-
$corpus = phutil_render_tag(
208+
$corpus = phutil_tag(
209209
'textarea',
210210
array(
211211
'style' => $style,
212212
),
213-
phutil_escape_html(implode("\n", $rows)));
213+
implode("\n", $rows));
214214

215215
break;
216216

@@ -493,11 +493,11 @@ private function buildDisplayRows(
493493
if (isset($blame['handle'])) {
494494
$author_link = $blame['handle']->renderLink();
495495
} else {
496-
$author_link = phutil_render_tag(
496+
$author_link = phutil_tag(
497497
'span',
498498
array(
499499
),
500-
phutil_escape_html($blame['author']));
500+
$blame['author']);
501501
}
502502
$display_line['author'] = $author_link;
503503

@@ -699,12 +699,12 @@ private function buildDisplayRows(
699699
idx($line, 'author'));
700700
}
701701

702-
$line_link = phutil_render_tag(
702+
$line_link = phutil_tag(
703703
'a',
704704
array(
705705
'href' => $line_href,
706706
),
707-
phutil_escape_html($line['line']));
707+
$line['line']);
708708

709709
$blame[] = javelin_render_tag(
710710
'th',

src/applications/diffusion/controller/DiffusionCommitBranchesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function processRequest() {
1414

1515
$branch_links = array();
1616
foreach ($branches as $branch => $commit) {
17-
$branch_links[] = phutil_render_tag(
17+
$branch_links[] = phutil_tag(
1818
'a',
1919
array(
2020
'href' => $request->generateURI(
@@ -23,7 +23,7 @@ public function processRequest() {
2323
'branch' => $branch,
2424
)),
2525
),
26-
phutil_escape_html($branch));
26+
$branch);
2727
}
2828

2929
return id(new AphrontAjaxResponse())

src/applications/diffusion/controller/DiffusionCommitController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ public function processRequest() {
178178
$change_panel->setID('toc');
179179

180180
if ($count > self::CHANGES_LIMIT) {
181-
$show_all_button = phutil_render_tag(
181+
$show_all_button = phutil_tag(
182182
'a',
183183
array(
184184
'class' => 'button green',
185185
'href' => '?show_all=true',
186186
),
187-
phutil_escape_html('Show All Changes'));
187+
'Show All Changes');
188188
$warning_view = id(new AphrontErrorView())
189189
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
190190
->setTitle('Very Large Commit')
@@ -399,10 +399,10 @@ private function loadCommitProperties(
399399
if ($commit->getAuditStatus()) {
400400
$status = PhabricatorAuditCommitStatusConstants::getStatusName(
401401
$commit->getAuditStatus());
402-
$props['Status'] = phutil_render_tag(
402+
$props['Status'] = phutil_tag(
403403
'strong',
404404
array(),
405-
phutil_escape_html($status));
405+
$status);
406406
}
407407

408408
$props['Committed'] = phabricator_datetime($commit->getEpoch(), $user);
@@ -892,7 +892,7 @@ private function buildRefs(DiffusionRequest $request) {
892892

893893
$ref_links = array();
894894
foreach ($refs as $ref) {
895-
$ref_links[] = phutil_render_tag(
895+
$ref_links[] = phutil_tag(
896896
'a',
897897
array(
898898
'href' => $request->generateURI(
@@ -901,7 +901,7 @@ private function buildRefs(DiffusionRequest $request) {
901901
'branch' => $ref,
902902
)),
903903
),
904-
phutil_escape_html($ref));
904+
$ref);
905905
}
906906
$ref_links = implode(', ', $ref_links);
907907
return $ref_links;

0 commit comments

Comments
 (0)