Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -1,7 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * |
5 | | - * |
6 | 4 | * Created on Dec 01, 2007 |
7 | 5 | * |
8 | 6 | * Copyright © 2007 Yuri Astrakhan <Firstname><Lastname>@gmail.com |
— | — | @@ -33,7 +31,6 @@ |
34 | 32 | * @ingroup API |
35 | 33 | */ |
36 | 34 | class ApiParse extends ApiBase { |
37 | | - |
38 | 35 | private $section, $text, $pstText = null; |
39 | 36 | |
40 | 37 | public function __construct( $main, $action ) { |
— | — | @@ -81,7 +78,6 @@ |
82 | 79 | $redirValues = null; |
83 | 80 | |
84 | 81 | if ( !is_null( $oldid ) || !is_null( $pageid ) || !is_null( $page ) ) { |
85 | | - |
86 | 82 | if ( !is_null( $oldid ) ) { |
87 | 83 | // Don't use the parser cache |
88 | 84 | $rev = Revision::newFromID( $oldid ); |
— | — | @@ -102,7 +98,6 @@ |
103 | 99 | |
104 | 100 | $p_result = $this->getParsedSectionOrText( $articleObj, $titleObj, $popts, $pageid, |
105 | 101 | isset( $prop['wikitext'] ) ) ; |
106 | | - |
107 | 102 | } else { // This is an old revision, so get the text differently |
108 | 103 | $this->text = $rev->getText( Revision::FOR_THIS_USER ); |
109 | 104 | |
— | — | @@ -114,9 +109,7 @@ |
115 | 110 | |
116 | 111 | $p_result = $wgParser->parse( $this->text, $titleObj, $popts ); |
117 | 112 | } |
118 | | - |
119 | 113 | } else { // Not $oldid |
120 | | - |
121 | 114 | if ( !is_null ( $pageid ) ) { |
122 | 115 | $titleObj = Title::newFromID( $pageid ); |
123 | 116 | |
— | — | @@ -124,7 +117,6 @@ |
125 | 118 | $this->dieUsageMsg( array( 'nosuchpageid', $pageid ) ); |
126 | 119 | } |
127 | 120 | } else { // $page |
128 | | - |
129 | 121 | if ( $params['redirects'] ) { |
130 | 122 | $req = new FauxRequest( array( |
131 | 123 | 'action' => 'query', |
— | — | @@ -158,7 +150,6 @@ |
159 | 151 | $p_result = $this->getParsedSectionOrText( $articleObj, $titleObj, $popts, $pageid, |
160 | 152 | isset( $prop['wikitext'] ) ) ; |
161 | 153 | } |
162 | | - |
163 | 154 | } else { // Not $oldid, $pageid, $page. Hence based on $text |
164 | 155 | |
165 | 156 | $this->text = $text; |
— | — | @@ -275,7 +266,7 @@ |
276 | 267 | if ( isset( $prop['iwlinks'] ) ) { |
277 | 268 | $result_array['iwlinks'] = $this->formatIWLinks( $p_result->getInterwikiLinks() ); |
278 | 269 | } |
279 | | - |
| 270 | + |
280 | 271 | if ( isset( $prop['wikitext'] ) ) { |
281 | 272 | $result_array['wikitext'] = array(); |
282 | 273 | $result->setContent( $result_array['wikitext'], $this->text ); |
— | — | @@ -349,7 +340,7 @@ |
350 | 341 | $entry = array(); |
351 | 342 | $bits = explode( ':', $link, 2 ); |
352 | 343 | $title = Title::newFromText( $link ); |
353 | | - |
| 344 | + |
354 | 345 | $entry['lang'] = $bits[0]; |
355 | 346 | if ( $title ) { |
356 | 347 | $entry['url'] = $title->getFullURL(); |