r61747 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61746‎ | r61747 | r61748 >
Date:17:45, 31 January 2010
Author:reedy
Status:ok
Tags:
Comment:
Part 1 of bug 18427 - "add comment= parameter to action=parse, spitting out <parsedcomment> with
the HTML"

Done outputting "parsedsummary", though, summary may suffice?
Modified paths:
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParse.php
@@ -136,10 +136,17 @@
137137 $result_array = array();
138138 if ( $params['redirects'] && !is_null( $redirValues ) )
139139 $result_array['redirects'] = $redirValues;
 140+
140141 if ( isset( $prop['text'] ) ) {
141142 $result_array['text'] = array();
142143 $result->setContent( $result_array['text'], $p_result->getText() );
143144 }
 145+
 146+ if ( !is_null( $params['summary'] ) ) {
 147+ $result_array['parsedsummary'] = array();
 148+ $result->setContent( $result_array['parsedsummary'], $wgUser->getSkin()->formatComment( $params['summary'], $titleObj ) );
 149+ }
 150+
144151 if ( isset( $prop['langlinks'] ) )
145152 $result_array['langlinks'] = $this->formatLangLinks( $p_result->getLanguageLinks() );
146153 if ( isset( $prop['categories'] ) )
@@ -242,6 +249,7 @@
243250 ApiBase :: PARAM_DFLT => 'API',
244251 ),
245252 'text' => null,
 253+ 'summary' => null,
246254 'page' => null,
247255 'redirects' => false,
248256 'oldid' => null,
@@ -270,6 +278,7 @@
271279 public function getParamDescription() {
272280 return array (
273281 'text' => 'Wikitext to parse',
 282+ 'summary' => 'Summary to parse',
274283 'redirects' => 'If the page parameter is set to a redirect, resolve it',
275284 'title' => 'Title of page the text belongs to',
276285 'page' => 'Parse the content of this page. Cannot be used together with text and title',

Follow-up revisions

RevisionCommit summaryAuthorDate
r61754bug 18427 - Parsed comment on prop=revisionreedy20:59, 31 January 2010
r61761Finish (bug 18427) Comment (edit summary) parser option for API...reedy23:06, 31 January 2010

Status & tagging log