From: Happy-melon Date: Tue, 1 Sep 2009 14:11:29 +0000 (+0000) Subject: Follow-up to r55700 - patch up a path through which Article::mParserOutput could... X-Git-Tag: 1.31.0-rc.0~39982 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=22fc4e78186a813ac91a21062e09a359d0822e2b;p=lhc%2Fweb%2Fwiklou.git Follow-up to r55700 - patch up a path through which Article::mParserOutput could be called without being set, and armour the call in Article::getRobotPolicy against other unforeseen paths. --- diff --git a/includes/Article.php b/includes/Article.php index 8824f72379..7436f60e0f 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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( "\n" ); return true;