Followup r77666, bug 26219
authorSam Reed <reedy@users.mediawiki.org>
Sat, 4 Dec 2010 00:36:33 +0000 (00:36 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 4 Dec 2010 00:36:33 +0000 (00:36 +0000)
Only add the message about multi value, if the type is not an array, or if it is an array, if it has over 50 (LIMIT_SML1) items

includes/api/ApiBase.php

index 95397d5..5bc99a6 100644 (file)
@@ -368,8 +368,13 @@ abstract class ApiBase {
                                                }
 
                                                if ( isset( $paramSettings[self::PARAM_ISMULTI] ) ) {
-                                                       $desc .= $paramPrefix . "Maximum number of values " .
+                                                       $isArray = is_array( $paramSettings[self::PARAM_TYPE] );
+
+                                                       if ( !$isArray
+                                                                       || $isArray && count( $paramSettings[self::PARAM_TYPE] ) > self::LIMIT_SML1) {
+                                                               $desc .= $paramPrefix . "Maximum number of values " .
                                                                        self::LIMIT_SML1 . " (" . self::LIMIT_SML2 . " for bots)";
+                                                       }
                                                }
                                        }
                                }