Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -79,6 +79,7 @@ |
80 | 80 | $popts->enableLimitReport( !$params['disablepp'] ); |
81 | 81 | $redirValues = null; |
82 | 82 | if ( !is_null( $oldid ) || !is_null( $pageid ) || !is_null( $page ) ) { |
| 83 | + |
83 | 84 | if ( !is_null( $oldid ) ) { |
84 | 85 | // Don't use the parser cache |
85 | 86 | $rev = Revision::newFromID( $oldid ); |
— | — | @@ -97,7 +98,7 @@ |
98 | 99 | if ( $titleObj->getLatestRevID() === intval( $oldid ) ) { |
99 | 100 | $articleObj = new Article( $titleObj, 0 ); |
100 | 101 | |
101 | | - $p_result = $this->getParsedSectionOrText( $articleObj, $titleObj, $text, $popts, $pageid ) ; |
| 102 | + $p_result = $this->getParsedSectionOrText( $articleObj, $titleObj, $articleObj->get, $popts, $pageid ) ; |
102 | 103 | |
103 | 104 | } else { |
104 | 105 | $text = $rev->getText( Revision::FOR_THIS_USER ); |
— | — | @@ -110,14 +111,16 @@ |
111 | 112 | |
112 | 113 | $p_result = $wgParser->parse( $text, $titleObj, $popts ); |
113 | 114 | } |
114 | | - } else { |
| 115 | + |
| 116 | + } else { // Not $oldid |
| 117 | + |
115 | 118 | if ( !is_null ( $pageid ) ) { |
116 | 119 | $titleObj = Title::newFromID( $pageid ); |
117 | 120 | |
118 | 121 | if ( !$titleObj ) { |
119 | 122 | $this->dieUsageMsg( array( 'nosuchpageid', $pageid ) ); |
120 | 123 | } |
121 | | - } else { |
| 124 | + } else { // $page |
122 | 125 | if ( $params['redirects'] ) { |
123 | 126 | $req = new FauxRequest( array( |
124 | 127 | 'action' => 'query', |
— | — | @@ -149,7 +152,9 @@ |
150 | 153 | |
151 | 154 | $p_result = $this->getParsedSectionOrText( $articleObj, $titleObj, $text, $popts, $pageid ) ; |
152 | 155 | } |
153 | | - } else { |
| 156 | + |
| 157 | + } else { // Not $oldid, $pageid, $page |
| 158 | + |
154 | 159 | $titleObj = Title::newFromText( $title ); |
155 | 160 | if ( !$titleObj ) { |
156 | 161 | $titleObj = Title::newFromText( 'API' ); |