}
}
- # Parse the text and replace links with placeholders
+ # Parse the text and save it to the parser cache
$wgOut = new OutputPage();
-
- # Pass the current title along in case we're creating a wiki page
- # which is different than the currently displayed one (e.g. image
- # pages created on file uploads); otherwise, link updates will
- # go wrong.
- $wgOut->addWikiTextWithTitle( $text, $this->mTitle );
+ $wgOut->setParserOptions( ParserOptions::newFromUser( $wgUser ) );
+ $wgOut->addPrimaryWikiText( $text, $this );
if ( !$wgUseDumbLinkUpdate ) {
# Move the current links back to the second register
* Saves the text into the parser cache if possible
*/
function addPrimaryWikiText( $text, $cacheArticle ) {
- global $wgParser, $wgParserCache, $wgUser, $wgTitle, $wgUseTidy;
+ global $wgParser, $wgParserCache, $wgUser, $wgUseTidy;
- $parserOutput = $wgParser->parse( $text, $wgTitle, $this->mParserOptions, true );
+ $parserOutput = $wgParser->parse( $text, $cacheArticle->mTitle, $this->mParserOptions, true );
$text = $parserOutput->getText();
function expired( $touched ) {
global $wgCacheEpoch;
return $this->getCacheTime() == -1 || // parser says it's uncacheable
- $this->getCacheTime() <= $touched ||
+ $this->getCacheTime() < $touched ||
$this->getCacheTime() <= $wgCacheEpoch ||
!isset( $this->mVersion ) ||
version_compare( $this->mVersion, MW_PARSER_VERSION, "lt" );