Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -131,18 +131,18 @@ |
132 | 132 | * All included pages/arguments are expanded out |
133 | 133 | */ |
134 | 134 | public static function expandText( $text, $title ) { |
135 | | - global $wgTitle; |
| 135 | + global $wgParser; |
| 136 | + |
| 137 | + $text = $text ? $text : ''; |
| 138 | + $wgParser->isStable = true; // Causes our hooks to trigger |
136 | 139 | |
137 | | - if( !$text ) return ''; |
138 | | - |
139 | | - $svParser = new Parser(); |
140 | | - $svParser->isStable = true; |
141 | | - |
142 | 140 | $options = new ParserOptions; |
143 | | - $options->setRemoveComments( true ); // Less bandwidth maybe... |
144 | | - $output = $svParser->preprocess( $text, $title, $options ); |
| 141 | + $options->setRemoveComments( true ); // Less banwidth? |
| 142 | + $outputText = $wgParser->preprocess( $text, $title, $options ); |
145 | 143 | |
146 | | - return $output; |
| 144 | + $wgParser->isStable = false; // Done! |
| 145 | + |
| 146 | + return $outputText; |
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
— | — | @@ -154,18 +154,17 @@ |
155 | 155 | * Get the HTML of a revision based on how it was during $timeframe |
156 | 156 | */ |
157 | 157 | public static function parseStableText( $title, $text, $id=NULL, $options ) { |
158 | | - global $wgUser; |
| 158 | + global $wgParser; |
159 | 159 | |
160 | | - $svParser = new Parser(); |
161 | | - $svParser->isStable = true; |
162 | | - |
163 | | - $options->setTidy(true); |
| 160 | + $wgParser->isStable = true; // Causes our hooks to trigger |
164 | 161 | # Don't show section-edit links |
165 | 162 | # They can be old and misleading |
166 | 163 | $options->setEditSection(false); |
167 | 164 | # Parse the new body, wikitext -> html |
168 | | - $parserOut = $svParser->parse( $text, $title, $options, true, true, $id ); |
| 165 | + $parserOut = $wgParser->parse( $text, $title, $options, true, true, $id ); |
169 | 166 | |
| 167 | + $wgParser->isStable = false; // Done! |
| 168 | + |
170 | 169 | return $parserOut; |
171 | 170 | } |
172 | 171 | |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php |
— | — | @@ -382,9 +382,6 @@ |
383 | 383 | // Update the article review log |
384 | 384 | $this->updateLog( $this->page, $this->dims, $this->comment, $this->oldid, false ); |
385 | 385 | |
386 | | - # Clear the cache... |
387 | | - $this->page->invalidateCache(); |
388 | | - |
389 | 386 | $article = new Article( $this->page ); |
390 | 387 | // Update the links tables as a new stable version |
391 | 388 | // may now be the default page. |
— | — | @@ -397,8 +394,8 @@ |
398 | 395 | $u = new LinksUpdate( $this->page, $poutput ); |
399 | 396 | $u->doUpdate(); |
400 | 397 | |
401 | | - # Might as well update the cache while we're at it |
402 | | - $parserCache->save( $poutput, $article, $wgUser ); |
| 398 | + # Clear the cache... |
| 399 | + $this->page->invalidateCache(); |
403 | 400 | # Purge squid for this page only |
404 | 401 | $this->page->purgeSquid(); |
405 | 402 | |