17 parent::__construct( $params );
18 if ( !$this->mLabel ) {
19 $this->mLabel = $this->
msg(
'restrictionsfield-label' )->parse();
24 $helpText = parent::getHelpText();
25 if ( $helpText ===
null ) {
26 $helpText = $this->
msg(
'restrictionsfield-help' )->parse();
36 if ( !$request->getCheck( $this->mName ) ) {
40 $value = rtrim( $request->getText( $this->mName ),
"\r\n" );
41 $ips = $value ===
'' ? [] : explode(
"\n", $value );
44 }
catch ( InvalidArgumentException $e ) {
53 $default = parent::getDefault();
54 if ( $default ===
null ) {
73 isset( $this->mParams[
'required'] ) && $this->mParams[
'required'] !==
false
76 return $this->
msg(
'htmlform-required' );
79 if ( is_string( $value ) ) {
82 foreach ( explode(
"\n", $value ) as $range ) {
84 $status->fatal(
'restrictionsfield-badip', $range );
88 $status->fatal(
'unknown-error' );
93 if ( isset( $this->mValidationCallback ) ) {
94 return call_user_func( $this->mValidationCallback, $value, $alldata, $this->mParent );
106 $value = implode(
"\n", $value->toArray()[
'IPAddresses'] );
108 return parent::getInputHTML( $value );
117 $value = implode(
"\n", $value->toArray()[
'IPAddresses'] );
119 return parent::getInputOOUI( $value );