Per Aaron, fix for r105764: only set the timestamp if it's set in the cached ParserOu...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 16 Dec 2011 20:55:54 +0000 (20:55 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 16 Dec 2011 20:55:54 +0000 (20:55 +0000)
includes/Article.php

index f2fb262..7ed28e6 100644 (file)
@@ -499,8 +499,12 @@ class Article extends Page {
                                                        # the correct version information.
                                                        $wgOut->setRevisionId( $this->mPage->getLatest() );
                                                        # Preload timestamp to avoid a DB hit
-                                                       $wgOut->setRevisionTimestamp( $this->mParserOutput->getTimestamp() );
-                                                       $this->mPage->setTimestamp( $this->mParserOutput->getTimestamp() );
+                                                       $cachedTimestamp = $this->mParserOutput->getTimestamp();
+                                                       var_dump( $cachedTimestamp );
+                                                       if ( $cachedTimestamp !== null ) {
+                                                               $wgOut->setRevisionTimestamp( $cachedTimestamp );
+                                                               $this->mPage->setTimestamp( $cachedTimestamp );
+                                                       }
                                                        $outputDone = true;
                                                }
                                        }