@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.

render_tag -> tag: phame, remarkup

Summary: Converts various callsites from render_tag variants to tag variants.

Test Plan: See inlines.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

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

+73 -54
+1 -1
src/applications/differential/field/specification/DifferentialBlameRevisionFieldSpecification.php
··· 48 48 return null; 49 49 } 50 50 $engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine(); 51 - return $engine->markupText($this->value); 51 + return phutil_safe_html($engine->markupText($this->value)); 52 52 } 53 53 54 54 public function shouldAppearOnConduitView() {
+1 -1
src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
··· 113 113 $userdata = idx($test, 'userdata'); 114 114 if ($userdata) { 115 115 $engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine(); 116 - $userdata = $engine->markupText($userdata); 116 + $userdata = phutil_safe_html($engine->markupText($userdata)); 117 117 $rows[] = array( 118 118 'style' => 'details', 119 119 'value' => $userdata,
+1 -1
src/applications/diffusion/controller/DiffusionBrowseController.php
··· 106 106 107 107 private function markupText($text) { 108 108 $engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine(); 109 - $text = $engine->markupText($text); 109 + $text = phutil_safe_html($engine->markupText($text)); 110 110 111 111 $text = phutil_tag( 112 112 'div',
+2 -1
src/applications/diffusion/controller/DiffusionCommitController.php
··· 93 93 94 94 $property_list->addTextContent( 95 95 '<div class="diffusion-commit-message phabricator-remarkup">'. 96 - $engine->markupText($commit_data->getCommitMessage()). 96 + phutil_safe_html( 97 + $engine->markupText($commit_data->getCommitMessage())). 97 98 '</div>' 98 99 ); 99 100
+1 -1
src/applications/diffusion/query/browse/DiffusionBrowseQuery.php
··· 127 127 } else { 128 128 // Markup extensionless files as remarkup so we get links and such. 129 129 $engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine(); 130 - $readme_content = $engine->markupText($readme_content); 130 + $readme_content = phutil_safe_html($engine->markupText($readme_content)); 131 131 132 132 $class = 'phabricator-remarkup'; 133 133 }
+1 -1
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 165 165 '//Nothing is known about this rare specimen.//'); 166 166 167 167 $engine = PhabricatorMarkupEngine::newProfileMarkupEngine(); 168 - $blurb = $engine->markupText($blurb); 168 + $blurb = phutil_safe_html($engine->markupText($blurb)); 169 169 170 170 $viewer = $this->getRequest()->getUser(); 171 171
+12 -4
src/applications/phame/skins/PhameBasicBlogSkin.php
··· 70 70 $view->setFrameable(true); 71 71 } 72 72 73 + 73 74 $view->appendChild($content); 74 75 75 76 $response = new AphrontWebpageResponse(); ··· 95 96 $summaries[] = $post->renderWithSummary(); 96 97 } 97 98 98 - $list = phutil_render_tag( 99 + $list = phutil_tag( 99 100 'div', 100 101 array( 101 102 'class' => 'phame-post-list', 102 103 ), 103 104 id(new AphrontNullView())->appendChild($summaries)->render()); 104 105 105 - $pager = $this->renderOlderPageLink().$this->renderNewerPageLink(); 106 - if ($pager) { 106 + $pager = null; 107 + if ($this->renderOlderPageLink() || $this->renderNewerPageLink()) { 107 108 $pager = phutil_tag( 108 109 'div', 109 110 array( 110 111 'class' => 'phame-pager', 112 + ), 113 + array( 114 + $this->renderOlderPageLink(), 115 + $this->renderNewerPageLink(), 111 116 )); 112 117 } 113 118 114 - return $list.$pager; 119 + return array( 120 + $list, 121 + $pager, 122 + ); 115 123 } 116 124 117 125 protected function render404Page() {
+43 -41
src/applications/phame/view/PhamePostView.php
··· 87 87 } 88 88 89 89 public function renderBody() { 90 - return phutil_render_tag( 90 + return phutil_tag( 91 91 'div', 92 92 array( 93 93 'class' => 'phame-post-body', ··· 96 96 } 97 97 98 98 public function renderSummary() { 99 - return phutil_render_tag( 99 + return phutil_tag( 100 100 'div', 101 101 array( 102 102 'class' => 'phame-post-body', ··· 159 159 array( 160 160 'id' => 'fb-root', 161 161 ), 162 - '' 163 - ); 162 + ''); 164 163 165 164 $c_uri = '//connect.facebook.net/en_US/all.js#xfbml=1&appId='.$fb_id; 166 - $fb_js = jsprintf( 167 - '<script>(function(d, s, id) {'. 168 - ' var js, fjs = d.getElementsByTagName(s)[0];'. 169 - ' if (d.getElementById(id)) return;'. 170 - ' js = d.createElement(s); js.id = id;'. 171 - ' js.src = %s;'. 172 - ' fjs.parentNode.insertBefore(js, fjs);'. 173 - '}(document, \'script\', \'facebook-jssdk\'));</script>', 174 - $c_uri 175 - ); 165 + $fb_js = phutil_safe_html( 166 + jsprintf( 167 + '<script>(function(d, s, id) {'. 168 + ' var js, fjs = d.getElementsByTagName(s)[0];'. 169 + ' if (d.getElementById(id)) return;'. 170 + ' js = d.createElement(s); js.id = id;'. 171 + ' js.src = %s;'. 172 + ' fjs.parentNode.insertBefore(js, fjs);'. 173 + '}(document, \'script\', \'facebook-jssdk\'));</script>', 174 + $c_uri)); 176 175 177 176 178 177 $uri = $this->getSkin()->getURI('post/'.$this->getPost()->getPhameTitle()); ··· 183 182 'data-href' => $uri, 184 183 'data-num-posts' => 5, 185 184 ), 186 - '' 187 - ); 185 + ''); 188 186 189 - return phutil_render_tag( 187 + return phutil_tag( 190 188 'div', 191 189 array( 192 190 'class' => 'phame-comments-facebook', 193 191 ), 194 - $fb_root. 195 - $fb_js. 196 - $fb_comments); 192 + array( 193 + $fb_root, 194 + $fb_js, 195 + $fb_comments, 196 + )); 197 197 } 198 198 199 199 private function renderDisqusComments() { ··· 211 211 ); 212 212 213 213 // protip - try some var disqus_developer = 1; action to test locally 214 - $disqus_js = jsprintf( 215 - '<script>'. 216 - ' var disqus_shortname = "phabricator";'. 217 - ' var disqus_identifier = %s;'. 218 - ' var disqus_url = %s;'. 219 - ' var disqus_title = %s;'. 220 - '(function() {'. 221 - ' var dsq = document.createElement("script");'. 222 - ' dsq.type = "text/javascript";'. 223 - ' dsq.async = true;'. 224 - ' dsq.src = "http://" + disqus_shortname + ".disqus.com/embed.js";'. 225 - '(document.getElementsByTagName("head")[0] ||'. 226 - ' document.getElementsByTagName("body")[0]).appendChild(dsq);'. 227 - '})(); </script>', 228 - $post->getPHID(), 229 - $this->getSkin()->getURI('post/'.$this->getPost()->getPhameTitle()), 230 - $post->getTitle() 231 - ); 214 + $disqus_js = phutil_safe_html( 215 + jsprintf( 216 + '<script>'. 217 + ' var disqus_shortname = "phabricator";'. 218 + ' var disqus_identifier = %s;'. 219 + ' var disqus_url = %s;'. 220 + ' var disqus_title = %s;'. 221 + '(function() {'. 222 + ' var dsq = document.createElement("script");'. 223 + ' dsq.type = "text/javascript";'. 224 + ' dsq.async = true;'. 225 + ' dsq.src = "http://" + disqus_shortname + ".disqus.com/embed.js";'. 226 + '(document.getElementsByTagName("head")[0] ||'. 227 + ' document.getElementsByTagName("body")[0]).appendChild(dsq);'. 228 + '})(); </script>', 229 + $post->getPHID(), 230 + $this->getSkin()->getURI('post/'.$this->getPost()->getPhameTitle()), 231 + $post->getTitle())); 232 232 233 - return phutil_render_tag( 233 + return phutil_tag( 234 234 'div', 235 235 array( 236 236 'class' => 'phame-comments-disqus', 237 237 ), 238 - $disqus_thread. 239 - $disqus_js); 238 + array( 239 + $disqus_thread, 240 + $disqus_js, 241 + )); 240 242 } 241 243 242 244 }
+8 -1
src/applications/remarkup/conduit/ConduitAPI_remarkup_process_Method.php
··· 43 43 $engine = PhabricatorMarkupEngine::$engine_class(); 44 44 $engine->setConfig('viewer', $request->getUser()); 45 45 46 + $text = $engine->markupText($content); 47 + if ($text) { 48 + $content = phutil_safe_html($text)->getHTMLContent(); 49 + } else { 50 + $content = ''; 51 + } 52 + 46 53 $result = array( 47 - 'content' => $engine->markupText($content), 54 + 'content' => $content, 48 55 ); 49 56 50 57 return $result;
+2 -1
src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
··· 203 203 foreach ($comments as $comment) { 204 204 $handle = $handles[$comment->getAuthorPHID()]; 205 205 206 - $markup = $engine->markupText($comment->getCommentText()); 206 + $markup = phutil_safe_html( 207 + $engine->markupText($comment->getCommentText())); 207 208 208 209 require_celerity_resource('phabricator-remarkup-css'); 209 210
+1 -1
src/infrastructure/markup/PhabricatorMarkupEngine.php
··· 160 160 "Call process() before getOutput()."); 161 161 } 162 162 163 - return $this->objects[$key]['output']; 163 + return new PhutilSafeHTML($this->objects[$key]['output']); 164 164 } 165 165 166 166