1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-10 14:51:06 +01:00

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
This commit is contained in:
epriestley 2013-01-28 18:46:04 -08:00
parent 114ed6c7fe
commit da27b448fa
3 changed files with 23 additions and 20 deletions

View file

@ -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'])) {

View file

@ -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,
);

View file

@ -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',
),
'<th colspan="2">'.$show_more.'</td>');
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',
),
'<th colspan="2">'.$hide_more.'</th>');
phutil_tag('th', array('colspan' => 2), $hide_more));
Javelin::initBehavior('differential-show-field-details');
}