@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add renderHTMLView

Summary:
- Implement AphrontView->renderHTMLView(), which works like AphrontView->renderSingleView() but always return PhutilSafeHTML.

Test Plan: Action list view no longer as broken.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D4642

+21 -4
+16
src/view/AphrontView.php
··· 50 50 } 51 51 } 52 52 53 + final protected function renderHTMLView($child) { 54 + if ($child instanceof AphrontView) { 55 + return phutil_safe_html($child->render()); 56 + } else if ($child instanceof PhutilSafeHTML) { 57 + return $child; 58 + } else if (is_array($child)) { 59 + $out = array(); 60 + foreach ($child as $element) { 61 + $out[] = $this->renderHTMLView($element); 62 + } 63 + return phutil_safe_html(implode('', $out)); 64 + } else { 65 + return phutil_safe_html(phutil_escape_html($child)); 66 + } 67 + } 68 + 53 69 abstract public function render(); 54 70 55 71 }
+3 -2
src/view/layout/PhabricatorActionListView.php
··· 36 36 } 37 37 38 38 require_celerity_resource('phabricator-action-list-view-css'); 39 - return phutil_render_tag( 39 + 40 + return phutil_tag( 40 41 'ul', 41 42 array( 42 43 'class' => 'phabricator-action-list-view', 43 44 ), 44 - $this->renderSingleView($actions)); 45 + $this->renderHTMLView($actions)); 45 46 } 46 47 47 48
+2 -2
src/view/layout/PhabricatorHeaderView.php
··· 39 39 } 40 40 41 41 if ($this->tags) { 42 - $header[] = phutil_render_tag( 42 + $header[] = phutil_tag( 43 43 'span', 44 44 array( 45 45 'class' => 'phabricator-header-tags', 46 46 ), 47 - self::renderSingleView($this->tags)); 47 + $this->renderHTMLView($this->tags)); 48 48 } 49 49 50 50 return phutil_tag(