public static function showBlankIfUnapproved(&$article, &$content) { global $egApprovedRevsBlankIfUnapproved; if (!$egApprovedRevsBlankIfUnapproved) { return true; } $title = $article->getTitle(); if (!ApprovedRevs::pageIsApprovable($title)) { return true; } $revisionID = ApprovedRevs::getApprovedRevID($title); if (!empty($revisionID)) { return true; } // This looks extreme - disable the cache for every page, // if users aren't meant to see pages with no approved // revision, and this page has no approved revision - but // there doesn't seem to be any other way to distinguish // between a user looking at the main view of page, and a // user specifically looking at the latest revision of the // page (which we don't want to show as blank.) global $wgEnableParserCache; $wgEnableParserCache = false; if (!ApprovedRevs::isDefaultPageRequest()) { return true; } ApprovedRevs::addCSS(); $content = ''; return true; }