X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiBase.php;h=62d73f480c0c0210cdf461e98f3b17530fe95ee2;hp=cb3c2f6da78d65d19f80add081dfff56168c4d73;hb=7babd362babcbf7f20adb8e12edb4f4bc1d4249f;hpb=17d001b73a3bd291e0f77794fa60fa5495609d68 diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index cb3c2f6da7..62d73f480c 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1,9 +1,5 @@ @gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -155,6 +151,7 @@ abstract class ApiBase extends ContextSource { * ((string|array|Message)[]) When PARAM_TYPE is an array, this is an array * mapping those values to $msg for ApiBase::makeMessage(). Any value not * having a mapping will use apihelp-{$path}-paramvalue-{$param}-{$value}. + * Specify an empty array to use the default message key for all values. * @since 1.25 */ const PARAM_HELP_MSG_PER_VALUE = 14; @@ -1029,7 +1026,7 @@ abstract class ApiBase extends ContextSource { * @param string $paramName Parameter name * @param array|mixed $paramSettings Default value or an array of settings * using PARAM_* constants. - * @param bool $parseLimit Parse limit? + * @param bool $parseLimit Whether to parse and validate 'limit' parameters * @return mixed Parameter value */ protected function getParameterFromSettings( $paramName, $paramSettings, $parseLimit ) { @@ -1081,10 +1078,10 @@ abstract class ApiBase extends ContextSource { } else { $type = 'NULL'; // allow everything } + } - if ( $type == 'password' || !empty( $paramSettings[self::PARAM_SENSITIVE] ) ) { - $this->getMain()->markParamsSensitive( $encParamName ); - } + if ( $type == 'password' || !empty( $paramSettings[self::PARAM_SENSITIVE] ) ) { + $this->getMain()->markParamsSensitive( $encParamName ); } if ( $type == 'boolean' ) { @@ -1407,7 +1404,7 @@ abstract class ApiBase extends ContextSource { protected function parseMultiValue( $valueName, $value, $allowMultiple, $allowedValues, $allSpecifier = null, $limit1 = null, $limit2 = null ) { - if ( ( trim( $value ) === '' || trim( $value ) === "\x1f" ) && $allowMultiple ) { + if ( ( $value === '' || $value === "\x1f" ) && $allowMultiple ) { return []; } $limit1 = $limit1 ?: self::LIMIT_SML1;