r79773 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79772‎ | r79773 | r79774 >
Date:23:19, 6 January 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Adding some spaces, and some else block comments (due to length or ApiParse [and as such bug 26534] being duplicated and crappy), to help matching and readability
Modified paths:
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParse.php
@@ -79,6 +79,7 @@
8080 $popts->enableLimitReport( !$params['disablepp'] );
8181 $redirValues = null;
8282 if ( !is_null( $oldid ) || !is_null( $pageid ) || !is_null( $page ) ) {
 83+
8384 if ( !is_null( $oldid ) ) {
8485 // Don't use the parser cache
8586 $rev = Revision::newFromID( $oldid );
@@ -97,7 +98,7 @@
9899 if ( $titleObj->getLatestRevID() === intval( $oldid ) ) {
99100 $articleObj = new Article( $titleObj, 0 );
100101
101 - $p_result = $this->getParsedSectionOrText( $articleObj, $titleObj, $text, $popts, $pageid ) ;
 102+ $p_result = $this->getParsedSectionOrText( $articleObj, $titleObj, $articleObj->get, $popts, $pageid ) ;
102103
103104 } else {
104105 $text = $rev->getText( Revision::FOR_THIS_USER );
@@ -110,14 +111,16 @@
111112
112113 $p_result = $wgParser->parse( $text, $titleObj, $popts );
113114 }
114 - } else {
 115+
 116+ } else { // Not $oldid
 117+
115118 if ( !is_null ( $pageid ) ) {
116119 $titleObj = Title::newFromID( $pageid );
117120
118121 if ( !$titleObj ) {
119122 $this->dieUsageMsg( array( 'nosuchpageid', $pageid ) );
120123 }
121 - } else {
 124+ } else { // $page
122125 if ( $params['redirects'] ) {
123126 $req = new FauxRequest( array(
124127 'action' => 'query',
@@ -149,7 +152,9 @@
150153
151154 $p_result = $this->getParsedSectionOrText( $articleObj, $titleObj, $text, $popts, $pageid ) ;
152155 }
153 - } else {
 156+
 157+ } else { // Not $oldid, $pageid, $page
 158+
154159 $titleObj = Title::newFromText( $title );
155160 if ( !$titleObj ) {
156161 $titleObj = Title::newFromText( 'API' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r814071.17: MFT r79454, r79455, r79456, r79536, r79727, r79733, r79773, r79774, r80...catrope19:18, 2 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79451Followup r75334. Change to int == string, rather than int === string (not goi...reedy22:35, 1 January 2011

Comments

#Comment by Reedy (talk | contribs)   23:38, 6 January 2011

Heh, amusing syntax error commited. Already fixed in r79774

Status & tagging log