Revert "Promote phutil-tag again"

This reverts commit 8fbabdc06d, reversing
changes made to 2dab1c1e42.
This commit is contained in:
epriestley
2013-02-13 14:08:57 -08:00
parent 8fbabdc06d
commit 73cce6e131
264 changed files with 1717 additions and 1691 deletions

View File

@@ -21,7 +21,7 @@ final class DiffusionBrowseController extends DiffusionController {
$title = 'Tag: '.$drequest->getSymbolicCommit();
$tag_view = new AphrontPanelView();
$tag_view->setHeader($title);
$tag_view->setHeader(phutil_escape_html($title));
$tag_view->appendChild(
$this->markupText($drequest->getTagContent()));
@@ -106,7 +106,7 @@ final class DiffusionBrowseController extends DiffusionController {
private function markupText($text) {
$engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine();
$text = $engine->markupText($text);
$text = phutil_safe_html($engine->markupText($text));
$text = phutil_tag(
'div',

View File

@@ -97,7 +97,8 @@ final class DiffusionCommitController extends DiffusionController {
array(
'class' => 'diffusion-commit-message phabricator-remarkup',
),
$engine->markupText($commit_data->getCommitMessage())));
phutil_safe_html(
$engine->markupText($commit_data->getCommitMessage()))));
$content[] = $top_anchor;
$content[] = $headsup_view;
@@ -448,7 +449,9 @@ final class DiffusionCommitController extends DiffusionController {
foreach ($parents as $parent) {
$parent_links[] = $handles[$parent->getPHID()]->renderLink();
}
$props['Parents'] = phutil_implode_html(" \xC2\xB7 ", $parent_links);
$props['Parents'] = array_interleave(
" \xC2\xB7 ",
$parent_links);
}
$request = $this->getDiffusionRequest();
@@ -485,7 +488,7 @@ final class DiffusionCommitController extends DiffusionController {
foreach ($task_phids as $phid) {
$task_list[] = $handles[$phid]->renderLink();
}
$task_list = phutil_implode_html(phutil_tag('br'), $task_list);
$task_list = array_interleave(phutil_tag('br'), $task_list);
$props['Tasks'] = $task_list;
}
@@ -494,7 +497,7 @@ final class DiffusionCommitController extends DiffusionController {
foreach ($proj_phids as $phid) {
$proj_list[] = $handles[$phid]->renderLink();
}
$proj_list = phutil_implode_html(phutil_tag('br'), $proj_list);
$proj_list = array_interleave(phutil_tag('br'), $proj_list);
$props['Projects'] = $proj_list;
}
@@ -686,7 +689,7 @@ final class DiffusionCommitController extends DiffusionController {
'inlineuri' => '/diffusion/inline/preview/'.$commit->getPHID().'/',
));
$preview_panel = hsprintf(
$preview_panel =
'<div class="aphront-panel-preview aphront-panel-flush">
<div id="audit-preview">
<div class="aphront-panel-preview-loading-text">
@@ -695,24 +698,27 @@ final class DiffusionCommitController extends DiffusionController {
</div>
<div id="inline-comment-preview">
</div>
</div>');
</div>';
// TODO: This is pretty awkward, unify the CSS between Diffusion and
// Differential better.
require_celerity_resource('differential-core-view-css');
return phutil_tag(
return phutil_render_tag(
'div',
array(
'id' => $pane_id,
),
hsprintf(
'<div class="differential-add-comment-panel">%s%s%s</div>',
phutil_render_tag(
'div',
array(
'class' => 'differential-add-comment-panel',
),
id(new PhabricatorAnchorView())
->setAnchorName('comment')
->setNavigationMarker(true)
->render(),
$panel->render(),
->render().
$panel->render().
$preview_panel));
}
@@ -932,7 +938,7 @@ final class DiffusionCommitController extends DiffusionController {
$ref);
}
return phutil_implode_html(', ', $ref_links);
return array_interleave(', ', $ref_links);
}
private function buildRawDiffResponse(DiffusionRequest $drequest) {

View File

@@ -103,7 +103,7 @@ final class DiffusionExternalController extends DiffusionController {
'href' => $href,
),
'r'.$repo->getCallsign().$commit->getCommitIdentifier()),
$commit->loadCommitData()->getSummary(),
phutil_escape_html($commit->loadCommitData()->getSummary()),
);
}

View File

@@ -19,7 +19,7 @@ final class DiffusionHomeController extends DiffusionController {
'href' => $shortcut->getHref(),
),
$shortcut->getName()),
$shortcut->getDescription(),
phutil_escape_html($shortcut->getDescription()),
);
}
@@ -130,7 +130,7 @@ final class DiffusionHomeController extends DiffusionController {
'href' => '/diffusion/'.$repository->getCallsign().'/',
),
$repository->getName()),
$repository->getDetail('description'),
phutil_escape_html($repository->getDetail('description')),
PhabricatorRepositoryType::getNameForRepositoryType(
$repository->getVersionControlSystem()),
$size,

View File

@@ -71,10 +71,11 @@ final class DiffusionLintController extends DiffusionController {
'<a href="%s">%s</a>',
$drequest->generateURI(array('action' => 'lint')),
$drequest->getCallsign()),
ArcanistLintSeverity::getStringForSeverity($code['maxSeverity']),
$code['code'],
$code['maxName'],
$code['maxDescription'],
phutil_escape_html(ArcanistLintSeverity::getStringForSeverity(
$code['maxSeverity'])),
phutil_escape_html($code['code']),
phutil_escape_html($code['maxName']),
phutil_escape_html($code['maxDescription']),
);
}

View File

@@ -34,9 +34,10 @@ final class DiffusionLintDetailsController extends DiffusionController {
$rows[] = array(
$path,
$line,
ArcanistLintSeverity::getStringForSeverity($message['severity']),
$message['name'],
$message['description'],
phutil_escape_html(ArcanistLintSeverity::getStringForSeverity(
$message['severity'])),
phutil_escape_html($message['name']),
phutil_escape_html($message['description']),
);
}
@@ -70,7 +71,7 @@ final class DiffusionLintDetailsController extends DiffusionController {
$content[] = id(new AphrontPanelView())
->setHeader(
($lint != '' ? $lint." \xC2\xB7 " : '').
($lint != '' ? phutil_escape_html($lint)." \xC2\xB7 " : '').
pht('%d Lint Message(s)', count($messages)))
->setCaption($link)
->appendChild($table)

View File

@@ -68,7 +68,7 @@ final class DiffusionRepositoryController extends DiffusionController {
'View Full Commit History');
$panel = new AphrontPanelView();
$panel->setHeader(hsprintf("Recent Commits &middot; %s", $all));
$panel->setHeader("Recent Commits &middot; {$all}");
$panel->appendChild($history_table);
$panel->setNoBackground();
@@ -125,7 +125,9 @@ final class DiffusionRepositoryController extends DiffusionController {
$rows = array();
foreach ($properties as $key => $value) {
$rows[] = array($key, $value);
$rows[] = array(
phutil_escape_html($key),
phutil_escape_html($value));
}
$table = new AphrontTableView($rows);

View File

@@ -81,8 +81,8 @@ final class DiffusionSymbolController extends DiffusionController {
$project_name = '-';
}
$file = $symbol->getPath();
$line = $symbol->getLineNumber();
$file = phutil_escape_html($symbol->getPath());
$line = phutil_escape_html($symbol->getLineNumber());
$repo = $symbol->getRepository();
if ($repo) {
@@ -101,17 +101,17 @@ final class DiffusionSymbolController extends DiffusionController {
),
$file.':'.$line);
} else if ($file) {
$location = $file.':'.$line;
$location = phutil_escape_html($file.':'.$line);
} else {
$location = '?';
}
$rows[] = array(
$symbol->getSymbolType(),
$symbol->getSymbolContext(),
$symbol->getSymbolName(),
$symbol->getSymbolLanguage(),
$project_name,
phutil_escape_html($symbol->getSymbolType()),
phutil_escape_html($symbol->getSymbolContext()),
phutil_escape_html($symbol->getSymbolName()),
phutil_escape_html($symbol->getSymbolLanguage()),
phutil_escape_html($project_name),
$location,
);
}