Merge "Replace deprecated `setIconTitle` with `setTitle`"
[lhc/web/wiklou.git] / includes / api / ApiBlock.php
index 3581ac8..ed3d01c 100644 (file)
@@ -57,25 +57,11 @@ class ApiBlock extends ApiBase {
                $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';
                        }
 
-                       $pageRestrictions = implode( "\n", $params['pagerestrictions'] );
+                       $pageRestrictions = implode( "\n", (array)$params['pagerestrictions'] );
                }
 
                if ( $params['userid'] !== null ) {
@@ -207,6 +193,8 @@ class ApiBlock extends ApiBase {
                        $params['partial'] = false;
                        $params['pagerestrictions'] = [
                                ApiBase::PARAM_ISMULTI => true,
+                               ApiBase::PARAM_ISMULTI_LIMIT1 => 10,
+                               ApiBase::PARAM_ISMULTI_LIMIT2 => 10,
                        ];
                }