$res = $dbr->select(
$revQuery['tables'],
$revQuery['fields'],
- array_merge( $conds, [ 'page_len <= ' . intval( $wgMaxMsgCacheEntrySize ) ] ),
+ array_merge( $conds, [
+ 'page_len <= ' . intval( $wgMaxMsgCacheEntrySize ),
+ 'page_latest = rev_id' // get the latest revision only
+ ] ),
__METHOD__ . "($code)-small",
[],
$revQuery['joins']
* @return Parser
*/
public function getParser() {
- global $wgParser, $wgParserConf;
-
- if ( !$this->mParser && isset( $wgParser ) ) {
+ global $wgParserConf;
+ if ( !$this->mParser ) {
+ $parser = MediaWikiServices::getInstance()->getParser();
# Do some initialisation so that we don't have to do it twice
- $wgParser->firstCallInit();
+ $parser->firstCallInit();
# Clone it and store it
$class = $wgParserConf['class'];
if ( $class == ParserDiffTest::class ) {
# Uncloneable
$this->mParser = new $class( $wgParserConf );
} else {
- $this->mParser = clone $wgParser;
+ $this->mParser = clone $parser;
}
}