aboutsummaryrefslogtreecommitdiffstats
path: root/includes/block/AutoblockExemptionList.php
Commit message (Collapse)AuthorAgeFilesLines
* block: Add $wgAutoblockExemptionsTaavi Väänänen2025-02-181-1/+19
| | | | | | | | | Add a new option to exempt users from autoblocks in the configuration, instead of editing a MediaWiki space page on every wiki. The use case for this is WMCS ranges (see T386689). Bug: T240542 Change-Id: I704b34b81214e7a1ac819fefa7ad3c2c87305647
* block: Split exemption list parsing to separate functionTaavi Väänänen2025-02-181-9/+16
| | | | Change-Id: Ic8672d708ff5c558199e5233a4e3fc758d6ac023
* AutoblockExemptionList: inject and use a text formatterDannyS7122023-11-031-3/+10
| | | | | | | Instead of relying on global state via wfMessage() Follow-up: I5049e60be1681f67fcca133e569e315792dc42dd Change-Id: I3efbb56271b02f545265f08cecd8e267ce70715d
* Move DatabaseBlock read query methods to DatabaseBlockStoreTim Starling2023-11-031-0/+55
* Move to DatabaseBlockStore the DatabaseBlock methods newFromID, getQueryInfo, getRangeCond, newFromRow, isExemptedFromAutoblocks, doAutoblock, updateTimestamp, getAutoblockExpiry, newFromTarget, newListFromTarget. * Split DatabaseBlock::getBlocksForIPList. Now BlockManager::getBlocksForIPList() is responsible for XFF header validation and trusted proxy handling. DatabaseBlockStore:: newListFromIPs() just does the queries and constructs the Block objects. * In DatabaseBlockStore::newFromRow() and doAutoblock(), use the DatabaseBlock constructor instead of calling many setter methods. Add constructor options decodedExpiry, decodedTimestamp, id, parentBlockId and restrictions to support this. * Move isExemptedFromAutoblocks() to its own service. Remove the cache since in my testing with production eval.php, the WAN cache fetch is 10 times slower than just using the message cache, contradicting the comment written in 2008. * Fix AuthManagerTest which was previously passing an unrecognised "restrictions" option to DatabaseBlock. Now that the option actually works, we have to use the right type. Bug: T255433 Change-Id: I5049e60be1681f67fcca133e569e315792dc42dd