$editingRestriction = 'sitewide';
$pageRestrictions = '';
if ( $this->getConfig()->get( 'EnablePartialBlocks' ) ) {
- if ( $params['pagerestrictions'] ) {
- $count = count( $params['pagerestrictions'] );
- if ( $count > 10 ) {
- $this->dieWithError(
- $this->msg(
- 'apierror-integeroutofrange-abovebotmax',
- 'pagerestrictions',
- 10,
- $count
- )
- );
- }
- }
-
if ( $params['partial'] ) {
$editingRestriction = 'partial';
}
$params['partial'] = false;
$params['pagerestrictions'] = [
ApiBase::PARAM_ISMULTI => true,
+ ApiBase::PARAM_ISMULTI_LIMIT1 => 10,
+ ApiBase::PARAM_ISMULTI_LIMIT2 => 10,
];
}
/**
* @expectedException ApiUsageException
- * @expectedExceptionMessage "pagerestrictions" may not be over 10 (set to 11) for bots or sysops.
+ * @expectedExceptionMessage Too many values supplied for parameter "pagerestrictions". The
+ * limit is 10.
*/
public function testBlockingToManyRestrictions() {
$this->setMwGlobals( [