MediaWiki REL1_35
PasswordDef.php
Go to the documentation of this file.
1<?php
2
4
6
16class PasswordDef extends StringDef {
17
18 public function normalizeSettings( array $settings ) {
19 $settings[ParamValidator::PARAM_SENSITIVE] = true;
20 return parent::normalizeSettings( $settings );
21 }
22
23 public function checkSettings( string $name, $settings, array $options, array $ret ) : array {
24 $ret = parent::checkSettings( $name, $settings, $options, $ret );
25
26 if ( ( $settings[ParamValidator::PARAM_SENSITIVE] ?? true ) !== true &&
27 !isset( $ret['issues'][ParamValidator::PARAM_SENSITIVE] )
28 ) {
29 $ret['issues'][ParamValidator::PARAM_SENSITIVE] =
30 'Cannot set PARAM_SENSITIVE to false for password-type parameters';
31 }
32
33 return $ret;
34 }
35
36}
Service for formatting and validating API parameters.
const PARAM_SENSITIVE
(bool) Indicate that the parameter's value should not be logged.
Type definition for "password" types.
normalizeSettings(array $settings)
Normalize a settings array Stable to override.
checkSettings(string $name, $settings, array $options, array $ret)
Validate a parameter settings array.
Type definition for string types.
Definition StringDef.php:24