public function isRawHtmlMessage() {
global $wgRawHtmlMessages;
- if ( $this->inNamespace( NS_MEDIAWIKI ) ) {
+ if ( !$this->inNamespace( NS_MEDIAWIKI ) ) {
return false;
}
- $message = lcfirst( $this->getRootText() );
+ $message = lcfirst( $this->getRootTitle()->getDBkey() );
return in_array( $message, $wgRawHtmlMessages, true );
}
if ( $nsText === false ) {
// See T165149. Awkward, but better than erroneously linking to the main namespace.
$nsText = MediaWikiServices::getInstance()->getContentLanguage()->
- getNsText( NS_SPECIAL ) . ":Badtitle/NS{$this->mNamespace}";
+ getNsText( NS_SPECIAL ) . ":Badtitle/NS{$this->mNamespace}";
}
$p .= $nsText . ':';
$id = $this->getArticleID();
if ( $id ) {
$cache = ObjectCache::getMainWANInstance();
+ $fname = __METHOD__;
$rows = $cache->getWithSetCallback(
// Page protections always leave a new null revision
$cache->makeKey( 'page-restrictions', $id, $this->getLatestRevID() ),
$cache::TTL_DAY,
- function ( $curValue, &$ttl, array &$setOpts ) {
+ function ( $curValue, &$ttl, array &$setOpts ) use ( $fname ) {
$dbr = wfGetDB( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr );
'page_restrictions',
[ 'pr_type', 'pr_expiry', 'pr_level', 'pr_cascade' ],
[ 'pr_page' => $this->getArticleID() ],
- __METHOD__
+ $fname
)
);
}
$revQuery['joins']
);
if ( $row ) {
- return new Revision( $row );
+ return new Revision( $row, 0, $this );
}
}
return null;