SECURITY: rate-limit and prevent blocked users from changing email
[lhc/web/wiklou.git] / includes / api / ApiAuthManagerHelper.php
index d6b9f76..2f66277 100644 (file)
@@ -48,7 +48,7 @@ class ApiAuthManagerHelper {
                $this->module = $module;
 
                $params = $module->extractRequestParams();
-               $this->messageFormat = isset( $params['messageformat'] ) ? $params['messageformat'] : 'wikitext';
+               $this->messageFormat = $params['messageformat'] ?? 'wikitext';
        }
 
        /**
@@ -345,10 +345,10 @@ class ApiAuthManagerHelper {
        /**
         * Fetch the standard parameters this helper recognizes
         * @param string $action AuthManager action
-        * @param string $param,... Parameters to use
+        * @param string ...$wantedParams Parameters to use
         * @return array
         */
-       public static function getStandardParams( $action, $param /* ... */ ) {
+       public static function getStandardParams( $action, ...$wantedParams ) {
                $params = [
                        'requests' => [
                                ApiBase::PARAM_TYPE => 'string',
@@ -384,8 +384,6 @@ class ApiAuthManagerHelper {
                ];
 
                $ret = [];
-               $wantedParams = func_get_args();
-               array_shift( $wantedParams );
                foreach ( $wantedParams as $name ) {
                        if ( isset( $params[$name] ) ) {
                                $ret[$name] = $params[$name];