dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Make deferred updates fully own their transaction rounds"
[lhc/web/wiklou.git]
/
includes
/
OutputPage.php
diff --git
a/includes/OutputPage.php
b/includes/OutputPage.php
index
eb3040c
..
6ae2a92
100644
(file)
--- a/
includes/OutputPage.php
+++ b/
includes/OutputPage.php
@@
-1265,7
+1265,7
@@
class OutputPage extends ContextSource {
$lb->setArray( $arr );
# Fetch existence plus the hiddencat property
$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' ]
$fields = array_merge(
LinkCache::getSelectFields(),
[ 'page_namespace', 'page_title', 'pp_value' ]
@@
-2303,7
+2303,6
@@
class OutputPage extends ContextSource {
// Hook that allows last minute changes to the output page, e.g.
// adding of CSS or Javascript by extensions.
Hooks::run( 'BeforePageDisplay', [ &$this, &$sk ] );
// 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();
try {
$sk->outputPage();
@@
-2536,7
+2535,7
@@
class OutputPage extends ContextSource {
}
/**
}
/**
- * 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
*
* If the lag is higher than $wgSlaveLagCritical seconds,
* then the warning is a bit more obvious. If the lag is
@@
-2547,6
+2546,7
@@
class OutputPage extends ContextSource {
public function showLagWarning( $lag ) {
$config = $this->getConfig();
if ( $lag >= $config->get( 'SlaveLagWarning' ) ) {
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';
$message = $lag < $config->get( 'SlaveLagCritical' )
? 'lag-warn-normal'
: 'lag-warn-high';
@@
-2674,6
+2674,7
@@
class OutputPage extends ContextSource {
'user.styles',
'user.cssprefs',
] );
'user.styles',
'user.cssprefs',
] );
+ $this->getSkin()->setupSkinUserCss( $this );
// Prepare exempt modules for buildExemptModules()
$exemptGroups = [ 'site' => [], 'noscript' => [], 'private' => [], 'user' => [] ];
// Prepare exempt modules for buildExemptModules()
$exemptGroups = [ 'site' => [], 'noscript' => [], 'private' => [], 'user' => [] ];
@@
-2688,12
+2689,6
@@
class OutputPage extends ContextSource {
// Special case in buildExemptModules()
return false;
}
// 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 ) ) {
if ( isset( $exemptGroups[$group] ) ) {
$exemptStates[$name] = 'ready';
if ( !$module->isKnownEmpty( $context ) ) {
@@
-2852,7
+2847,6
@@
class OutputPage extends ContextSource {
private function isUserJsPreview() {
return $this->getConfig()->get( 'AllowUserJs' )
private function isUserJsPreview() {
return $this->getConfig()->get( 'AllowUserJs' )
- && $this->getUser()->isLoggedIn()
&& $this->getTitle()
&& $this->getTitle()->isJsSubpage()
&& $this->userCanPreview();
&& $this->getTitle()
&& $this->getTitle()->isJsSubpage()
&& $this->userCanPreview();
@@
-2860,7
+2854,6
@@
class OutputPage extends ContextSource {
private function isUserCssPreview() {
return $this->getConfig()->get( 'AllowUserCss' )
private function isUserCssPreview() {
return $this->getConfig()->get( 'AllowUserCss' )
- && $this->getUser()->isLoggedIn()
&& $this->getTitle()
&& $this->getTitle()->isCssSubpage()
&& $this->userCanPreview();
&& $this->getTitle()
&& $this->getTitle()->isCssSubpage()
&& $this->userCanPreview();
@@
-3097,6
+3090,11
@@
class OutputPage extends ContextSource {
}
$user = $this->getUser();
}
$user = $this->getUser();
+
+ if ( !$user->isLoggedIn() ) {
+ // Anons have predictable edit tokens
+ return false;
+ }
if ( !$user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) {
return false;
}
if ( !$user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) {
return false;
}