Avoid master queries on page views in loadFilterData()

Bug: T92357
Change-Id: Ib7928067bc0b7ebd631d8abc96e3c24f81e78414
This commit is contained in:
Aaron Schulz 2016-04-28 13:50:08 -07:00
parent 71bb512d93
commit f7367dc970

View file

@ -823,7 +823,9 @@ class AbuseFilterViewEdit extends AbuseFilterView {
}
// Load from master to avoid unintended reversions where there's replication lag.
$dbr = wfGetDB( DB_MASTER );
$dbr = $this->getRequest()->wasPosted()
? wfGetDB( DB_MASTER )
: wfGetDB( DB_SLAVE );
// Load certain fields only. This prevents a condition seen on Wikimedia where
// a schema change adding a new field caused that extra field to be selected.