$lb->setArray( $arr );
# Fetch existence plus the hiddencat property
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$fields = array_merge(
LinkCache::getSelectFields(),
[ 'page_namespace', 'page_title', 'pp_value' ]
// Hook that allows last minute changes to the output page, e.g.
// adding of CSS or Javascript by extensions.
Hooks::run( 'BeforePageDisplay', [ &$this, &$sk ] );
- $this->getSkin()->setupSkinUserCss( $this );
try {
$sk->outputPage();
}
/**
- * Show a warning about slave lag
+ * Show a warning about replica DB lag
*
* If the lag is higher than $wgSlaveLagCritical seconds,
* then the warning is a bit more obvious. If the lag is
public function showLagWarning( $lag ) {
$config = $this->getConfig();
if ( $lag >= $config->get( 'SlaveLagWarning' ) ) {
+ $lag = floor( $lag ); // floor to avoid nano seconds to display
$message = $lag < $config->get( 'SlaveLagCritical' )
? 'lag-warn-normal'
: 'lag-warn-high';
'user.styles',
'user.cssprefs',
] );
+ $this->getSkin()->setupSkinUserCss( $this );
// Prepare exempt modules for buildExemptModules()
$exemptGroups = [ 'site' => [], 'noscript' => [], 'private' => [], 'user' => [] ];
// Special case in buildExemptModules()
return false;
}
- if ( $name === 'site.styles' ) {
- // HACK: Technically, 'site.styles' isn't in a separate request group.
- // But, in order to ensure its styles are in the right position,
- // pretend it's in a group called 'site'.
- $group = 'site';
- }
if ( isset( $exemptGroups[$group] ) ) {
$exemptStates[$name] = 'ready';
if ( !$module->isKnownEmpty( $context ) ) {
private function isUserJsPreview() {
return $this->getConfig()->get( 'AllowUserJs' )
- && $this->getUser()->isLoggedIn()
&& $this->getTitle()
&& $this->getTitle()->isJsSubpage()
&& $this->userCanPreview();
private function isUserCssPreview() {
return $this->getConfig()->get( 'AllowUserCss' )
- && $this->getUser()->isLoggedIn()
&& $this->getTitle()
&& $this->getTitle()->isCssSubpage()
&& $this->userCanPreview();
}
$user = $this->getUser();
+
+ if ( !$user->isLoggedIn() ) {
+ // Anons have predictable edit tokens
+ return false;
+ }
if ( !$user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) {
return false;
}