Follow-up to r55700 - patch up a path through which Article::mParserOutput could...
authorHappy-melon <happy-melon@users.mediawiki.org>
Tue, 1 Sep 2009 14:11:29 +0000 (14:11 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Tue, 1 Sep 2009 14:11:29 +0000 (14:11 +0000)
includes/Article.php

index 8824f72..7436f60 100644 (file)
@@ -1032,9 +1032,9 @@ class Article {
                        $policy = array_merge( $policy,
                                               self::formatRobotPolicy( $wgNamespaceRobotPolicies[$ns] ) );
                }
-
-               if( $this->mTitle->canUseNoindex() && $this->mParserOutput->getIndexPolicy() ){
-                       # __INDEX__ and __NOINDEX__ magic words, if allowed.
+               if( $this->mTitle->canUseNoindex() && is_object( $this->mParserOutput ) && $this->mParserOutput->getIndexPolicy() ){
+                       # __INDEX__ and __NOINDEX__ magic words, if allowed. Incorporates
+                       # a final sanity check that we have really got the parser output.
                        $policy = array_merge( $policy,
                                               array( 'index' => $this->mParserOutput->getIndexPolicy() ) );
                }
@@ -1335,6 +1335,7 @@ class Article {
                        wfDebug( __METHOD__.": sending dirty output\n" );
                        wfDebugLog( 'dirty', "dirty output " . $parserCache->getKey( $this, $options ) . "\n" );
                        $wgOut->setSquidMaxage( 0 );
+                       $this->mParserOutput = $output;
                        $wgOut->addParserOutput( $output );
                        $wgOut->addHTML( "<!-- parser cache is expired, sending anyway due to pool overload-->\n" );
                        return true;