Merge "Fix sessionfailure i18n message during authentication"
[lhc/web/wiklou.git] / includes / api / ApiParamInfo.php
index 480575c..bfd3d61 100644 (file)
@@ -1,9 +1,5 @@
 <?php
 /**
- *
- *
- * Created on Dec 01, 2007
- *
  * Copyright © 2008 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
@@ -371,11 +367,15 @@ class ApiParamInfo extends ApiBase {
 
                        $item['multi'] = !empty( $settings[ApiBase::PARAM_ISMULTI] );
                        if ( $item['multi'] ) {
-                               $item['limit'] = $this->getMain()->canApiHighLimits() ?
-                                       ApiBase::LIMIT_SML2 :
-                                       ApiBase::LIMIT_SML1;
-                               $item['lowlimit'] = ApiBase::LIMIT_SML1;
-                               $item['highlimit'] = ApiBase::LIMIT_SML2;
+                               $item['lowlimit'] = !empty( $settings[ApiBase::PARAM_ISMULTI_LIMIT1] )
+                                       ? $settings[ApiBase::PARAM_ISMULTI_LIMIT1]
+                                       : ApiBase::LIMIT_SML1;
+                               $item['highlimit'] = !empty( $settings[ApiBase::PARAM_ISMULTI_LIMIT2] )
+                                       ? $settings[ApiBase::PARAM_ISMULTI_LIMIT2]
+                                       : ApiBase::LIMIT_SML2;
+                               $item['limit'] = $this->getMain()->canApiHighLimits()
+                                       ? $item['highlimit']
+                                       : $item['lowlimit'];
                        }
 
                        if ( !empty( $settings[ApiBase::PARAM_ALLOW_DUPLICATES] ) ) {
@@ -467,6 +467,12 @@ class ApiParamInfo extends ApiBase {
                        if ( !empty( $settings[ApiBase::PARAM_RANGE_ENFORCE] ) ) {
                                $item['enforcerange'] = true;
                        }
+                       if ( isset( $settings[self::PARAM_MAX_BYTES] ) ) {
+                               $item['maxbytes'] = $settings[self::PARAM_MAX_BYTES];
+                       }
+                       if ( isset( $settings[self::PARAM_MAX_CHARS] ) ) {
+                               $item['maxchars'] = $settings[self::PARAM_MAX_CHARS];
+                       }
                        if ( !empty( $settings[ApiBase::PARAM_DEPRECATED_VALUES] ) ) {
                                $deprecatedValues = array_keys( $settings[ApiBase::PARAM_DEPRECATED_VALUES] );
                                if ( is_array( $item['type'] ) ) {