1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-16 16:58:38 +01:00

Kill some PhutilSafeHTML

Summary: Also couple of unrelated Ponder changes.

Test Plan: /Q5

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4858
This commit is contained in:
vrana 2013-02-07 15:57:37 -08:00
parent 7dd19ba93f
commit 138da5a279
5 changed files with 22 additions and 28 deletions

View file

@ -1666,7 +1666,7 @@ CREATE TABLE `ponder_question` (
UNIQUE KEY `phid` (`phid`), UNIQUE KEY `phid` (`phid`),
KEY `authorPHID` (`authorPHID`), KEY `authorPHID` (`authorPHID`),
KEY `heat` (`heat`) KEY `heat` (`heat`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11;
CREATE DATABASE `{$NAMESPACE}_project` /*!40100 DEFAULT CHARACTER SET utf8 */; CREATE DATABASE `{$NAMESPACE}_project` /*!40100 DEFAULT CHARACTER SET utf8 */;

View file

@ -22,7 +22,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
array( array(
'class' => 'setup-issue-instructions', 'class' => 'setup-issue-instructions',
), ),
new PhutilSafeHTML(nl2br(phutil_escape_html($issue->getMessage())))); phutil_escape_html_newlines($issue->getMessage()));
$configs = $issue->getPHPConfig(); $configs = $issue->getPHPConfig();
if ($configs) { if ($configs) {

View file

@ -316,9 +316,10 @@ final class PhabricatorDirectoryMainController
array( array(
'class' => 'phabricator-jump-nav-caption', 'class' => 'phabricator-jump-nav-caption',
), ),
new PhutilSafeHTML( hsprintf(
'Enter the name of an object like <tt>D123</tt> to quickly jump to '. 'Enter the name of an object like <tt>D123</tt> to quickly jump to '.
'it. See '.$doc_link.' or type <tt>help</tt>.')); 'it. See %s or type <tt>help</tt>.',
$doc_link));
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
$panel->setHeader('Jump Nav'); $panel->setHeader('Jump Nav');

View file

@ -39,7 +39,7 @@ final class PhabricatorApplicationPonder extends PhabricatorApplication {
return true; return true;
} }
public function getroutes() { public function getRoutes() {
return array( return array(
'/Q(?P<id>[1-9]\d*)' => 'PonderQuestionViewController', '/Q(?P<id>[1-9]\d*)' => 'PonderQuestionViewController',
'/ponder/' => array( '/ponder/' => array(
@ -53,7 +53,8 @@ final class PhabricatorApplicationPonder extends PhabricatorApplication {
'comment/add/' => 'PonderCommentSaveController', 'comment/add/' => 'PonderCommentSaveController',
'(?P<kind>question)/vote/' => 'PonderVoteSaveController', '(?P<kind>question)/vote/' => 'PonderVoteSaveController',
'(?P<kind>answer)/vote/' => 'PonderVoteSaveController' '(?P<kind>answer)/vote/' => 'PonderVoteSaveController'
)); ),
);
} }
}
}

View file

@ -51,24 +51,20 @@ final class PonderCommentListView extends AphrontView {
$comment->getMarkupField(), $comment->getMarkupField(),
$this->user); $this->user);
$comment_anchor = '<a name="comment-' . $comment->getID() . '" />'; $comment_anchor = '';
$comment_markup[] = $comment_markup[] = hsprintf(
'<tr>'. '<tr>'.
'<th>'. '<th><a name="comment-%s" /></th>'.
$comment_anchor.
'</th>'.
'<td>'. '<td>'.
'<div class="phabricator-remarkup ponder-comment-markup">'. '<div class="phabricator-remarkup ponder-comment-markup">'.
$body. '%s&nbsp;&mdash;%s&nbsp;<span class="ponder-datestamp">%s</span>'.
'&nbsp;&mdash;'.
$handle->renderLink().
'&nbsp;'.
'<span class="ponder-datestamp">'.
phabricator_datetime($comment->getDateCreated(), $user).
'</span>'.
'</div>'. '</div>'.
'</td>'. '</td>'.
'</tr>'; '</tr>',
$comment->getID(),
$body,
$handle->renderLink(),
phabricator_datetime($comment->getDateCreated(), $user));
} }
$addview = id(new PonderAddCommentView) $addview = id(new PonderAddCommentView)
@ -77,20 +73,16 @@ final class PonderCommentListView extends AphrontView {
->setQuestionID($this->questionID) ->setQuestionID($this->questionID)
->setActionURI($this->actionURI); ->setActionURI($this->actionURI);
$comment_markup[] = $comment_markup[] = hsprintf(
'<tr>'. '<tr><th>&nbsp;</th><td>%s</td></tr>',
'<th>&nbsp;</th>'. $addview->render());
'<td>'.$addview->render().'</td>'.
'</tr>';
$comment_markup = phutil_tag( $comment_markup = phutil_tag(
'table', 'table',
array( array(
'class' => 'ponder-comments', 'class' => 'ponder-comments',
), ),
new PhutilSafeHTML(implode("\n", $comment_markup)) $comment_markup);
);
return $comment_markup; return $comment_markup;
} }